async def help(e): if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): s = e.text.split() if len(s) == 2: if HELPER[s[1]]: await e.edit(str(HELPER[s[1]])) else: t = await e.edit("Please specify which module do you want help for!") string = "" print(HELPER.keys()) for i in HELPER.keys(): string += str(i) string += "\n" await t.reply(string)
async def ambiladzan(adzan12): if 'sholat' in adzan12.raw_text: if not adzan12.pattern_match.group(1): LOKASI = TEMPAT if not LOKASI: await adzan12.edit("Please specify a city or a state.") return else: LOKASI = adzan12.pattern_match.group(1) url = f'http://muslimsalat.com/{LOKASI}.json?key=bd099c5825cbedb9aa934e255a81a5fc' request = requests.get(url) result = json.loads(request.text) if request.status_code != 200: await adzan12.edit(f"{result['status_description']}") return tanggal = result["items"][0]["date_for"] lokasi = result["query"] lokasi2 = result["country"] lokasi3 = result["address"] lokasi4 = result["state"] subuh = result["items"][0]["fajr"] syuruk = result["items"][0]["shurooq"] zuhur = result["items"][0]["dhuhr"] ashar = result["items"][0]["asr"] maghrib = result["items"][0]["maghrib"] isya = result["items"][0]["isha"] textkirim = (f"⏱ **Jadwal Sholat Pada ** `{tanggal}`:\n" + f"`{lokasi} | {lokasi2} | {lokasi3} | {lokasi4}`\n\n" + f"**Subuh :** `{subuh}`\n" + f"**Syuruk :** `{syuruk}`\n" + f"**Zuhur :** `{zuhur}`\n" + f"**Ashar :** `{ashar}`\n" + f"**Maghrib :** `{maghrib}`\n" + f"**Isya :** `{isya}`\n") await adzan12.reply(textkirim) HELPER.update({ "adzan": ".adzan <city> or .adzan <country>\ \nUsage: Gets the prayer time for moslem.\n" })
results['best_guess'] = best_guess.get_text() return results async def scam(results, lim): single = opener.open(results['similar_images']).read() decoded = single.decode('utf-8') imglinks = [] counter = 0 pattern = r'^,\[\"(.*[.png|.jpg|.jpeg])\",[0-9]+,[0-9]+\]$' oboi = re.findall(pattern, decoded, re.I | re.M) for imglink in oboi: counter += 1 if not counter >= int(lim): imglinks.append(imglink) else: break return imglinks HELPER.update({ 'reverse': '.reverse\ \nUsage: Reply to a pic/sticker to revers-search it on Google Images !!' })
if unblock.reply_to_msg_id: reply = await unblock.get_reply_message() replied_user = await unblock.client( GetFullUserRequest(reply.from_id)) name0 = str(replied_user.user.first_name) await unblock.client(UnblockRequest(replied_user.user.id)) if LOGGER: await unblock.client.send_message( LOGGER_GROUP, f"[{name0}](tg://user?id={replied_user.user.id})" " was unblocc'd!.", ) HELPER.update({ "pmpermit": "\ .approve\ \nUsage: Approves the mentioned/replied person to PM.\ \n\n.block\ \nUsage: Blocks the person from PMing you.\ \n\n.unblock\ \nUsage: Unblocks the person so they can PM you.\ \n\n.notifoff\ \nUsage: Clears any notifications of unapproved PMs.\ \n\n.notifon\ \nUsage: Allows notifications for unapproved PMs.\ " })
+ str(COUNT_MSG) + " messages from " + str(len(USERS)) + " chats while you were away", ) for i in USERS: name = await notafk.client.get_entity(i) name0 = str(name.first_name) await notafk.client.send_message( LOGGER_GROUP, "[" + name0 + "](tg://user?id=" + str(i) + ")" + " sent you " + "`" + str(USERS[i]) + " messages`", ) COUNT_MSG = 0 USERS = {} AFKREASON = "No Reason" HELPER.update({ "afk": ".afk <reason>(reason is optional)\ \nUsage: Sets you as afk. Responds to anyone who tags/PM's \ you telling that you are afk. Switches off AFK when you type back anything.\ " })
limit=lim)) input_photos = [] for sep in pfplist.photos: input_photos.append( InputPhoto( id=sep.id, access_hash=sep.access_hash, file_reference=sep.file_reference ) ) await bot(DeletePhotosRequest(id=input_photos)) await delpfp.edit(f"`Successfully deleted {len(input_photos)} profile picture(s).`") HELPER.update({ "username": "******" }) HELPER.update({ "name": ".name <firstname> or .name <firstname> <lastname>\ \nUsage: Changes your Telegram name.\ \n(First and last name will get split by the first space)" }) HELPER.update({ "profilepic": ".profilepic\ \nUsage: Reply with .profilepic to an image to change \ your Telegram profie picture." }) HELPER.update({ "setbio": ".setbio <new_bio>\ \nUsage: Changes your Telegram bio." })
size1 = image.width size2 = image.height if image.width > image.height: scale = 512 / size1 size1new = 512 size2new = size2 * scale else: scale = 512 / size2 size1new = size1 * scale size2new = 512 size1new = math.floor(size1new) size2new = math.floor(size2new) sizenew = (size1new, size2new) image = image.resize(sizenew) else: image.thumbnail(maxsize) return image HELPER.update({ "kang": ".kang\ \nUsage: Reply .kang to a sticker or an image to kang it to your userbot pack.\ \n\n.kang [emoji('s)]\ \nUsage: Works just like .kang but uses the emoji('s) you picked.\ \n\n.kang [number]\ \nUsage: Kang's the sticker/image to the specified pack but uses 🤔 as emoji.\ \n\n\nPlease kang this. Made by @rupansh." })
if not loc.text[0].isalpha() and loc.text[0] not in ("/", "#", "@", "!"): global COUNTRY temp_country = loc.pattern_match.group(1).title() time_zone = await get_tz(temp_country) if not time_zone: await loc.edit("``` Wrong country given! Try again! ```") return try: c_name = c_n[temp_country] except KeyError: c_name = temp_country COUNTRY = c_name await loc.edit(f"``` Default country for date and time set to {COUNTRY} successfully! ```") HELPER.update({ "time": ".time <country name/code>\ \nUsage: Gets the time of a country." }) HELPER.update({ "date": ".date <country name/code>\ \nUsage: Gets the date of a country." }) HELPER.update({ "ctime": ".ctime <country name/code>\ \nUsage: Sets a default country for your userbot so you can do .time/.date." })
stdout, stderr = await process.communicate() result = str(stdout.decode().strip()) \ + str(stderr.decode().strip()) if len(result) > 4096: output = open("output.txt", "w+") output.write(result) output.close() await term.client.send_file( term.chat_id, "output.txt", reply_to=term.id, caption="`Output too large, sending as file`", ) subprocess.run(["rm", "output.txt"], stdout=subprocess.PIPE) return await term.edit("`" f"{curruser}:~# {command}" f"\n{result}" "`") if LOGGER: await term.client.send_message( LOGGER_GROUP, "Terminal Command " + command + " was executed sucessfully", ) HELPER.update({"eval": ".eval 2 + 3\nUsage: Evalute mini-expressions."}) HELPER.update( {"exec": ".exec print('hello')\nUsage: Execute small python scripts."}) HELPER.update( {"term": ".term ls\nUsage: Run bash commands and scripts on your server."})
name, user_id)) @register(outgoing=True, pattern="^.chatid$") async def chatidgetter(e): if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): await e.edit("Chat ID: `" + str(e.chat_id) + "`") @register(outgoing=True, pattern="^.log") async def log(e): if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): textx = await e.get_reply_message() message = textx message = str(message.message) if LOGGER: await (await e.get_reply_message()).forward_to(LOGGER_GROUP) await e.edit("`Logged Successfully`") else: await e.edit("`This feature requires Logging to be enabled!`") sleep(2) await e.delete() HELPER.update({"chatid": "Fetches the current chat's ID"}) HELPER.update({ "userid": "Fetches the ID of the user in reply, if its a forwarded message, finds the ID for the source." })
@register(outgoing=True, pattern="^.rmnotes$") async def purge_notes(prg): """ For .rmnotes command, remove every note in the chat at once. """ if not prg.text[0].isalpha() and prg.text[0] not in ("/", "#", "@", "!"): try: from userbot.modules.sql_helper.notes_sql import rm_all_notes except AttributeError: await prg.edit("`Running on Non-SQL mode!`") return if not prg.text[0].isalpha(): await prg.edit("```Purging all notes.```") rm_all_notes(str(prg.chat_id)) if LOGGER: await prg.client.send_message( LOGGER_GROUP, "I cleaned all notes at " + str(prg.chat_id)) HELPER.update({ "notes": "\ #<notename>\ \nUsage: Gets the note with name notename\ \n\n.save <notename> <notedata>\ \nUsage: Saves notedata as a note with the name notename\ \n\n.clear <notename>\ \nUsage: Deletes the note with name notename.\ " })
@register(outgoing=True, pattern="^.filters$") async def filters_active(event): """ For .filters command, lists all of the active filters in a chat. """ if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@", "!"): try: from userbot.modules.sql_helper.filter_sql import get_filters except AttributeError: await event.edit("`Running on Non-SQL mode!`") return transact = "`There are no filters in this chat.`" filters = get_filters(event.chat_id) for i in filters: message = "Active filters in this chat: \n\n" transact = message + "🔹 " + i.keyword + "\n" await event.edit(transact) HELPER.update({ "filters": "\ .filters\ \nUsage: List all active filters in this chat.\ \n\n.filter <keyword> <reply message>\ \nUsage: Add a filter to this chat. \ The bot will now reply that message whenever 'keyword' is mentioned. \ If you reply to a sticker with a keyword, the bot will reply with that sticker.\ \nNOTE: all filter keywords are in lowercase.\ \n\n.stop <filter>\ \nUsage: Stops that filter.\ " })
await (await log_text.get_reply_message()).forward_to(LOGGER_GROUP) await log_text.edit("`Logged Successfully`") else: await log_text.edit("`This feature requires Logging to be enabled!`") sleep(2) await log_text.delete() @register(outgoing=True, pattern="^.kickme$") async def kickme(leave): """ Basically it's .kickme command """ if not leave.text[0].isalpha() and leave.text[0] not in ("/", "#", "@", "!"): await leave.edit("`Nope, no, no, I go away`") await bot(LeaveChannelRequest(leave.chat_id)) HELPER.update({ "chatid" : "Fetches the current chat's ID" }) HELPER.update({ "userid" : "Fetches the ID of the user in reply, if its a \ forwarded message, finds the ID for the source." }) HELPER.update({ "log" : "Forwards the message you've replied to in your \ logger group." }) HELPER.update({ "kickme" : "Leave from a targeted group." })
await conv.get_response() # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) file.seek(0) await conv.send_file(file, force_document=True) await conv.get_response() await conv.send_message(emoji) # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await conv.get_response() await conv.send_message("/publish") # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await conv.get_response() await conv.send_message("/skip") # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await conv.get_response() await conv.send_message(packname) # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await conv.get_response() # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await args.edit(f"sticker added! Your pack can be found [here](t.me/addstickers/{packname})", parse_mode='md') HELPER.update({ "kang": "Kang very important module. Please kang this. Made by @rupansh" })
"PNG", "2560x1440"), stream=True, ) content_type = response_api.headers["content-type"] if "image" in content_type: temp_file_name = "screencapture.png" with open(temp_file_name, "wb") as file: for chunk in response_api.iter_content(chunk_size=128): file.write(chunk) try: await url.client.send_file( url.chat_id, temp_file_name, caption=input_str, force_document=True, reply_to=url.message.reply_to_msg_id, ) await url.delete() except: await url.edit(response_api.text) os.remove(temp_file_name) else: await url.edit(response_api.text) HELPER.update({ "screencapture": ".screencapture <url>\ \nUsage: Takes a screenshot of a website and sends the screenshot." })
countrycode = timezone_countries[f'{country}'] except KeyError: await city.edit("Invalid country.") return CITY = newcity[0].strip() + "," + countrycode.strip() url = f'https://api.openweathermap.org/data/2.5/weather?q={CITY}&appid={APPID}' request = requests.get(url) result = json.loads(request.text) if request.status_code != 200: await city.edit(f"{result['message']}") return DEFCITY = CITY cityname = result['name'] country = result['sys']['country'] fullc_n = c_n[f"{country}"] await city.edit(f"Set default city as {cityname}, {fullc_n}.") HELPER.update({ "weather": ".weather <city> or .weather <city>, <country name/code>\ \nUsage: Gets the weather of a city.\n\ \n.setcity <city> or .setcity <city>, <country name/code>\ \nUsage: Sets your default city so you can just use .weather." })
"`Are you a stupid animal which is attracted to colours?`") @register(pattern='.type ?(.*)') async def typewriter(typew): """ Just a small command to make your keyboard become a typewriter! """ if not typew.text[0].isalpha() and typew.text[0] not in ("/", "#", "@", "!"): textx = await typew.get_reply_message() message = typew.pattern_match.group(1) if message: pass elif textx: message = textx.text else: await typew.edit("`Give a text to type!`") return sleep_time = 0.03 typing_symbol = "|" old_text = '' await typew.edit(typing_symbol) await asyncio.sleep(sleep_time) for character in message: old_text = old_text + "" + character typing_text = old_text + "" + typing_symbol await typew.edit(typing_text) await asyncio.sleep(sleep_time) await typew.edit(old_text) await asyncio.sleep(sleep_time) HELPER.update({"memes": "Ask Thoncc (@Skittles9823Bot) for that."})
global DEFAULTUSER DEFAULTUSER = newuser output = 'Successfully changed user to ' + newuser + '!' await username.edit("`" f"{output}" "`") @register(outgoing=True, pattern="^.resetalive$") async def amireallyalivereset(ureset): """ For .resetalive command, reset the username in the .alive command. """ if not ureset.text[0].isalpha() and ureset.text[0] not in ("/", "#", "@", "!"): global DEFAULTUSER DEFAULTUSER = uname().node await ureset.edit("`" "Successfully reset user for alive!" "`") HELPER.update( {"sysd": ".sysd\ \nUsage: Shows system information using neofetch."}) HELPER.update({"botver": ".botver\ \nUsage: Shows the userbot version."}) HELPER.update( {"pip": ".pip <module(s)>\ \nUsage: Does a search of pip modules(s)."}) HELPER.update({ "alive": ".alive\ \nUsage: It's used to check if your bot is working or not. \ Use .aliveu <new_user> to change user or .resetalive to reset .alive." })
) return try: check = re.match(repl, to_fix, flags=re.IGNORECASE) if check and check.group(0).lower() == to_fix.lower(): await command.edit( "`That's a reply, sed won't work.`" ) return if "i" in flags and "g" in flags: text = re.sub(repl, repl_with, to_fix, flags=re.I).strip() elif "i" in flags: text = re.sub(repl, repl_with, to_fix, count=1, flags=re.I).strip() elif "g" in flags: text = re.sub(repl, repl_with, to_fix).strip() else: text = re.sub(repl, repl_with, to_fix, count=1).strip() except sre_err: await command.edit("Syntax error!") return if text: await e.edit('Did you mean \n\n"{}"?'.format(text)) HELPER.update({ "sed": "sed<delimiter><old word(s)><delimiter><new word(s)>\ \nUsage: Replaces a word or words using sed.\ \nDelimiters: `/, :, |, _`" })
if res.result: output += f"\n\n**Result:** \n```{res.result}```" if res.warnings: output += f"\n\n**Warnings:** \n```{res.warnings}```\n" if res.errors: output += f"\n\n**Errors:** \n'```{res.errors}```" if len(res.result) > 4096: with io.BytesIO(str.encode(res.result)) as out_file: out_file.name = "result.txt" await bot.send_file(chat.id, file=out_file) await e.edit(code) return await e.edit(output) HELPER.update({"leave": "Leave a Chat"}) HELPER.update({";__;": "You try it!"}) HELPER.update({"cry": "Cry"}) HELPER.update({"fp": "Send face palm emoji."}) HELPER.update({"moon": "Bot will send a cool moon animation."}) HELPER.update({"clock": "Bot will send a cool clock animation."}) HELPER.update({"readme": "Reedme."}) HELPER.update({"sauce": "source."}) HELPER.update({"disapprove": "Disapprove anyone in PM."}) HELPER.update({"myusernames": "List of Usernames owned by you."}) HELPER.update({"oof": "Same as ;__; but ooof"})
if isinstance(probable_user_mention_entity, MessageEntityMentionName): user_id = probable_user_mention_entity.user_id user_obj = await event.client.get_entity(user_id) return user_obj try: user_obj = await event.client.get_entity(user) except (TypeError, ValueError) as err: await event.edit(str(err)) return None return user_obj HELPER.update({ "promote": "Usage: Reply to someone's message with .promote to promote them." }) HELPER.update( {"ban": "Usage: Reply to someone's message with .ban to ban them."}) HELPER.update({ "demote": "Usage: Reply to someone's message with .demote to revoke their admin permissions." }) HELPER.update({ "unban": "Usage: Reply to someone's message with .unban to unban them in this chat." }) HELPER.update({ "mute": "Usage: Reply to someone's message with .mute to mute them, works on admins too" })
w=1, h=1, round_message=True, supports_streaming=True, ) ], progress_callback=progress, ) elif spam_big_messages: await uas_event.edit("TBD: Not (yet) Implemented") return end = datetime.now() duration = (end - start).seconds os.remove(thumb) await uas_event.edit("Uploaded in {} seconds.".format(duration) ) except FileNotFoundError as err: await uas_event.edit(str(err)) else: await uas_event.edit("404: File Not Found") HELPER.update({ "download": ".download <link>\nUsage: Downloads file from link to the server." }) HELPER.update({ "upload": ".upload <link>\nUsage: Uploads a locally stored file to telegram." })
v_url.chat_id, f'{safe_filename(video.title)}.mp4', caption=f"{video.title}", thumb="thumbnail.jpg" ) os.remove(f"{safe_filename(video.title)}.mp4") os.remove('thumbnail.jpg') await v_url.delete() def deEmojify(inputString): """ Remove emojis and other non-safe characters from string """ return inputString.encode('ascii', 'ignore').decode('ascii') HELPER.update({ 'img': ".img <search_query>\ \nUsage: Does an image search on Google and shows two images." }) HELPER.update({ 'google': ".google <search_query>\ \nUsage: Does a search on Google." }) HELPER.update({ 'wiki': ".wiki <search_query>\ \nUsage: Does a Wikipedia search." }) HELPER.update({ 'ud': ".ud <search_query>\ \nUsage: Does a search on Urban Dictionary." }) HELPER.update({ 'tts': ".tts <text> or reply to someones text with .trt\
counter = int(message[4:6]) text = str(destroy.text[6:]) text = (text + "\n\n`This message shall be self-destructed in " + str(counter) + " seconds`") await destroy.delete() smsg = await destroy.client.send_message(destroy.chat_id, text) sleep(counter) await smsg.delete() if LOGGER: await destroy.client.send_message(LOGGER_GROUP, "sd query done successfully") HELPER.update({ 'purge': '.purge\ \nUsage: Purges all messages starting from the reply.' }) HELPER.update({ 'purgeme': '.purgeme <x>\ \nUsage: Deletes x amount of your latest messages.' }) HELPER.update({"del": ".del\ \nUsage: Deletes the message you replied to."}) HELPER.update({ 'editme': ".editme <newmessage>\
if username: username = format(username) else: username = "******" if user_bio: user_bio = user_bio else: user_bio = "User has no bio." caption = "<b>USER INFO</b> \n" caption += f"First name: {first_name} \n" caption += f"Last name: {last_name} \n" caption += f"Username: @{username} \n" caption += f"Bot: {is_bot} \n" caption += f"Restricted: {restricted} \n" caption += f"Verified by Telegram: {verified} \n" caption += f"ID: <code>{user_id}</code> \n" caption += f"Bio: {user_bio} \n" caption += f"Common chats with this user: {common_chat} \n" caption += f"Permanent link to profile: " caption += f"<a href=\"https://t.me/{username}\">{first_name}</a>" return photo, caption HELPER.update({ "whois": ".whois <username> or reply to someones text with .whois\ \nUsage: Gets info of an user." })
await e.edit("Processing 90%") file = '/home/carbon.png' await e.edit("Done!!") await bot.send_file( e.chat_id, file, reply_to=e.message.reply_to_msg_id, ) os.remove('/home/carbon.png') # Removing carbon.png after uploading await e.delete() HELPER.update({"carbon": ".carbon <text> \n Beautify your code"}) HELPER.update({ 'setlang': ".setlang <Lang> \ \nUsage: It will set language for you carbon module " }) HELPER.update({"leave": "Leave a Chat"}) HELPER.update({";__;": "You try it!"}) HELPER.update({"cry": "Cry"}) HELPER.update({"fp": "Send face palm emoji."}) HELPER.update({"moon": "Bot will send a cool moon animation."}) HELPER.update({"clock": "Bot will send a cool clock animation."}) HELPER.update({"readme": "Reedme."}) HELPER.update({"sauce": "source."}) HELPER.update({"disapprove": "Disapprove anyone in PM."}) HELPER.update({"myusernames": "List of Usernames owned by you."})
if resp.status_code != 200: try: res = resp.json() await dog_url.reply(res['message']) except json.decoder.JSONDecodeError: if resp.status_code == 404: await dog_url.edit('`Failed to reach dogbin`') else: await dog_url.edit('`Unknown error occured`') resp.raise_for_status() reply_text = "`Fetched dogbin URL content successfully!`\n\n`Content:` " + resp.text await dog_url.reply(reply_text) if LOGGER: await dog_url.client.send_message( LOGGER_GROUP, "Get dogbin content query for `" + message + "` was executed successfully", ) HELPER.update({ "paste": "Create a paste or a shortened url using dogbin (https://del.dog/)" }) HELPER.update({ "get_dogbin_content": "Get the content of a paste or shortened url from dogbin (https://del.dog/)" }) HELPER.update({ "pastestats": "Get stats of a paste or shortened url from dogbin (https://del.dog/)" })
result = await event.client(functions.help.GetNearestDcRequest()) await event.edit(f"Country : `{result.country}` \n" f"Nearest Datacenter : `{result.nearest_dc}` \n" f"This Datacenter : `{result.this_dc}`") @register(outgoing=True, pattern="^.pingme$") async def pingme(pong): """ FOr .pingme command, ping the userbot from any chat. """ if not pong.text[0].isalpha() and pong.text[0] not in ("/", "#", "@", "!"): start = datetime.now() await pong.edit("`Pong!`") end = datetime.now() duration = (end - start).microseconds / 1000 await pong.edit("Pong!\n%sms" % (duration)) HELPER.update( {"speed": ".speed\ \nUsage: Does a speedtest and shows the results."}) HELPER.update({ "nearestdc": ".nearestdc\ \nUsage: Finds the nearest datacenter from your server." }) HELPER.update({ "pingme": ".pingme\ \nUsage: Shows how long it takes to ping your bot." })
if not wannahelp.text[0].isalpha() and wannahelp.text[0] not in ("/", "#", "@", "!"): await wannahelp.edit("Link Portal: @userbot_support") @register(outgoing=True, pattern="^.repo$") async def repo_is_here(wannasee): """ For .repo command, just returns the repo URL. """ if not wannasee.text[0].isalpha() and wannasee.text[0] not in ("/", "#", "@", "!"): await wannasee.edit("https://github.com/AliHasan7671/userbot") HELPER.update({ 'random': '.random <item1> <item2> ... <itemN>\ \nUsage: Get a random item from the list of items.' }) HELPER.update({ 'sleep': '.sleep 10\ \nUsage: Userbots get tired too. Let yours snooze for a few seconds.' }) HELPER.update({ "shutdown": ".shutdown\ \nUsage: Sometimes you need to restart your bot. Sometimes you just hope to\ hear Windows XP shutdown sound... but you don't." })
x = await e.respond( "`You recieved " + str(COUNT_MSG) + " messages while you were away. Check log for more details.`" + "`This auto-generated message shall be self destructed in 2 seconds.`" ) time.sleep(2) await x.delete() if LOGGER: await e.client.send_message( LOGGER_GROUP, "You've recieved " + str(COUNT_MSG) + " messages from " + str(len(USERS)) + " chats while you were away", ) for i in USERS: name = await e.client.get_entity(i) name0 = str(name.first_name) await e.client.send_message( LOGGER_GROUP, "[" + name0 + "](tg://user?id=" + str(i) + ")" + " sent you " + "`" + str(USERS[i]) + " messages`", ) COUNT_MSG = 0 USERS = {} AFKREASON = "No Reason" HELPER.update({ "afk": "Usage: \nSets you as afk. Responds to anyone who tags/PM's you telling that you are afk. Switches off AFK when you type back anything." })