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_SOURCE") await x.edit(get_string("cha_4")) 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_source_channel_added(y): rem_source_channel(y) await eor(x, get_string("cha_5"), time=3) elif is_source_channel_added(y): rem_source_channel(y) await eor(x, get_string("cha_5"), time=5) elif not is_source_channel_added(y): await eor(x, "Source channel is already removed from database. ", time=3)
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_SOURCE") await x.edit(get_string("cha_4")) 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_source_channel_added(y): rem_source_channel(y) await eor(x, get_string("cha_5"), time=3) elif is_source_channel_added(y): rem_source_channel(y) await eor(x, get_string("cha_5"), time=5) elif not is_source_channel_added(y): await eor(x, "Source channel is already removed from database. ", time=3)
async def source(e): x = e.pattern_match.group(1) try: y = int(x) except Exception: try: y = int((await ultroid_bot.get_entity(x)).id) except Exception as es: print(es) return if not is_source_channel_added(y): add_source_channel(y) await eor(e, get_string("cha_2")) elif is_source_channel_added(y): await eor(e, get_string("cha_3"))
async def source(e): x = e.pattern_match.group(1).strip() if not x: y = e.chat_id else: try: y = await e.client.parse_id(x) except Exception as er: LOGS.exception(er) return if not is_source_channel_added(y): add_source_channel(y) await e.eor(get_string("cha_2")) ultroid_bot.add_handler(autopost_func, events.NewMessage()) elif is_source_channel_added(y): await e.eor(get_string("cha_3"))