async def _(event): all_chnnl = get_all_chnnl() if len(all_chnnl) == 0: await event.edit("No Channel Or Group Found On Database. Please Check Again") return total_errors = 0 total_count = 0 total_chnnl = len(all_chnnl) if event.reply_to_msg_id: hmm = await event.get_reply_message() else: event.edit("Reply To Some Message.") return try: for forbard in all_chnnl: await hmm.forward_to(forbard.chat_id) total_count += 1 except Exception as e: total_errors += 1 try: logger.info(f"Error : {error_count}\nError : {e} \nUsers : {chat_id}") except: pass await event.edit( f"Forward Success in {total_count} And Failed In {total_errors} And Total Channel In Db is {total_chnnl}" ) await borg.send_message( loggy_grp, f"Forward Success in {total_count} And Failed In {total_errors} And Total Channel In Db is {total_chnnl}", )
async def _(event): if event.fwd_from: return all_chnnl = get_all_chnnl() if len(all_chnnl) == 0: await event.edit( "No Channel Or Group Found On Database. Please Check Again") return total_errors = 0 total_count = 0 errorno = "" total_chnnl = len(all_chnnl) if event.reply_to_msg_id: hmm = await event.get_reply_message() else: event.edit("Reply To Some Message.") return try: for forbard in all_chnnl: await hmm.forward_to(forbard.chat_id) total_count += 1 except Exception as e: total_errors += 1 errorno += f"{e} \n" await borg.send_message( loggy_grp, f"Failed in {forbard.chat_id} Because Of Error : `{errorno}` \n\n", ) await event.edit( f"Forward Success in {total_count} And Failed In {total_errors} And Total Channel In Db is {total_chnnl}" ) await borg.send_message( loggy_grp, f"Forward Success in {total_count} And Failed In {total_errors} And Total Channel In Db is {total_chnnl}", )
async def _(event): if event.fwd_from: return all_chnnl = get_all_chnnl() if len(all_chnnl) == 0: await edit_or_reply( event, "No Channel Or Group Found On Database. Please Check Again") return total_errors = 0 total_count = 0 errorno = "" total_chnnl = len(all_chnnl) if event.reply_to_msg_id: hmm = await event.get_reply_message() else: await edit_or_reply(event, "Reply To Some Message.") return try: for forbard in all_chnnl: await borg.forward_messages(forbard.chat_id, hmm) total_count += 1 except Exception as e: total_errors += 1 poppo = await edit_or_reply( event, f"Forward Success in {total_count} And Failed In {total_errors} And Total Channel In Db is {total_chnnl}" ) try: await borg.send_message( loggy_grp, f"Forward Success in {total_count} And Failed In {total_errors} And Total Channel In Db is {total_chnnl}", ) except: pass
async def _(event): if event.fwd_from: return input_chnnl = event.pattern_match.group(1) all_chnnl = get_all_chnnl() if input_chnnl == "all": for channelz in all_chnnl: rm_channel(channelz.chat_id) await edit_or_reply(event, "Fine. Cleared All Channel Database") return if input_chnnl == "": if event.is_channel and event.is_group: input_chnnl = event.chat_id else: await edit_or_reply(event, "Please Give Group / Channel ID") return if already_added(input_chnnl): rm_channel(input_chnnl) await edit_or_reply( event, f"Fine. I have Removed {input_chnnl} From DataBase.") await borg.send_message(loggy_grp, f"Removed {input_chnnl} From DB") elif not already_added(input_chnnl): await edit_or_reply( event, "Are You Sure? , You Haven't Added This Group / Channel To Database" )
async def _(event): await event.edit("**Fine. Broadcasting in Progress. Kindly Wait !**") sedpath = Config.TMP_DOWNLOAD_DIRECTORY all_chnnl = get_all_chnnl() if len(all_chnnl) == 0: await event.edit( "No Channel Or Group Found On Database. Please Check Again") return total_errors = 0 total_count = 0 errorno = "" total_chnnl = len(all_chnnl) if event.reply_to_msg_id: hmm = await event.get_reply_message() else: event.edit("Reply To Some Message.") return if hmm and hmm.media: ok = await borg.download_media(hmm.media, sedpath) for channelz in all_chnnl: try: await borg.send_file(int(channelz.chat_id), file=ok, caption=hmm.text) total_count += 1 except Exception as e: total_errors += 1 errorno += f"{e} \n" await borg.send_message( loggy_grp, f"Error : {total_errors}\nError : {errorno}", ) if os.path.exists(ok): os.remove(ok) elif hmm and hmm.text: for channelz in all_chnnl: try: await borg.send_message(int(channelz.chat_id), hmm.text) total_count += 1 except Exception as e: total_errors += 1 errorno += f"{e} \n" await borg.send_message( loggy_grp, f"Error : {total_errors}\nError : {errorno}", ) elif hmm.message.poll: await event.edit("Bruh, This Can't Be Broadcasted.") return await event.edit( f"BroadCast Success In : {total_count} \nFailed In : {total_errors} \nTotal Channel In DB : {total_chnnl}" ) await borg.send_message( loggy_grp, f"BroadCast Success In : {total_count} \nFailed In : {total_errors} \nTotal Channel In DB : {total_chnnl}", )
async def _(event): total_chnnl = get_all_chnnl() chnnl_list = "" for starked in total_chnnl: try: chnnl_list += ("==> {} \n").format(starked.chat_id) except Exception: pass with io.BytesIO(str.encode(chnnl_list)) as tedt_file: tedt_file.name = "dbchnnllist.txt" await borg.send_file( event.chat_id, tedt_file, force_document=True, caption="Total Channel In DB.", allow_cache=False, )