Exemple #1
0
async def dd(event):
    chat_id = event.pattern_match.group(1)
    x = await eor(event, get_string("com_1"))
    if chat_id == "all":
        await x.edit(get_string("bd_8"))
        udB.delete("CH_DESTINATION")
        await x.edit("Destinations database cleared.")
        return
    try:
        y = int(chat_id)
    except Exception:
        try:
            y = int((await event.client.get_entity(chat_id)).id)
        except Exception as es:
            print(es)
            return
    if is_destination_added(y):
        rem_destination(y)
        await eor(x, "Destination removed from database")
    elif is_destination_added(y):
        rem_destination(y)
        await eor(x, "Destination removed from database", time=5)
    elif not is_destination_added(y):
        await eor(x,
                  "Destination channel is already removed from database. ",
                  time=5)
async def dd(event):
    chat_id = event.pattern_match.group(1)
    x = await event.eor(get_string("com_1"))
    if chat_id == "all":
        await x.edit(get_string("bd_8"))
        udB.del_key("CH_DESTINATION")
        await x.edit("Destinations database cleared.")
        return
    if chat_id:
        try:
            y = await e.client.parse_id(chat_id)
        except Exception as er:
            LOGS.exception(er)
            return
    else:
        y = event.chat_id
    if is_destination_added(y):
        rem_destination(y)
        await eor(x, "Destination removed from database")
    elif is_destination_added(y):
        rem_destination(y)
        await eor(x, "Destination removed from database", time=5)
    elif not is_destination_added(y):
        await eor(x,
                  "Destination channel is already removed from database. ",
                  time=5)
Exemple #3
0
async def destination(e):
    x = e.pattern_match.group(1).strip()
    if x:
        try:
            y = await e.client.parse_id(x)
        except Exception as er:
            LOGS.exception(er)
            return
    else:
        y = e.chat_id
    if not is_destination_added(y):
        add_destination(y)
        await e.eor("Destination added succesfully")
    elif is_destination_added(y):
        await e.eor("Destination channel already added")
Exemple #4
0
async def destination(e):
    x = e.pattern_match.group(1)
    try:
        y = int(x)
    except Exception:
        try:
            y = int((await e.client.get_entity(x)).id)
        except Exception as es:
            print(es)
            return
    if not is_destination_added(y):
        add_destination(y)
        await eor(e, "Destination added succesfully")
    elif is_destination_added(y):
        await eor(e, "Destination channel already added")