Team Ai
Apppublic

azils3/bash

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
echo_db.py44 linesDownload Raw Back to dB
1# Ultroid - UserBot2# Copyright (C) 2021-2025 TeamUltroid3#4# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >5# PLease read the GNU Affero General Public License in6# <https://github.com/TeamUltroid/pyUltroid/blob/main/LICENSE>.7 8from .. import udB9 10 11def get_stuff():12    return udB.get_key("ECHO") or {}13 14 15def add_echo(chat, user):16    x = get_stuff()17    if k := x.get(int(chat)):18        if user not in k:19            k.append(int(user))20        x.update({int(chat): k})21    else:22        x.update({int(chat): [int(user)]})23    return udB.set_key("ECHO", x)24 25 26def rem_echo(chat, user):27    x = get_stuff()28    if k := x.get(int(chat)):29        if user in k:30            k.remove(int(user))31        x.update({int(chat): k})32    return udB.set_key("ECHO", x)33 34 35def check_echo(chat, user):36    x = get_stuff()37    if (k := x.get(int(chat))) and int(user) in k:38        return True39 40 41def list_echo(chat):42    x = get_stuff()43    return x.get(int(chat))44