2 |
3 |
6 |
7 |
12 |
13 |
14 | [](https://github-stats-alpha.vercel.app/api?username=MURALIBOTZ&cc=000&tc=fff&ic=fff&bc=000"MURALIBOTZ)
15 |
16 |
17 |
18 |
48 |
--------------------------------------------------------------------------------
/AiChatBot/__init__.py:
--------------------------------------------------------------------------------
1 | import asyncio
2 | import logging
3 | import time
4 | from importlib import import_module
5 | from os import listdir, path
6 | from dotenv import load_dotenv
7 | import config
8 | import pymongo
9 | from pyrogram import Client
10 | from config import API_ID, API_HASH, BOT_TOKEN, OWNER_ID
11 | from pyrogram.enums import ParseMode, ChatMemberStatus
12 | from Abg import patch
13 |
14 | loop = asyncio.get_event_loop()
15 | load_dotenv()
16 | boot = time.time()
17 |
18 |
19 | logging.basicConfig(
20 | format="[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s",
21 | level=logging.INFO,
22 | )
23 |
24 | logging.getLogger("pyrogram").setLevel(logging.ERROR)
25 | logging.getLogger("pymongo").setLevel(logging.ERROR)
26 |
27 | # Hehehe
28 |
29 | class ChikuBot(Client):
30 | def __init__(self):
31 | super().__init__(
32 | name="Chikubot",
33 | api_id=config.API_ID,
34 | api_hash=config.API_HASH,
35 | lang_code="en",
36 | bot_token=config.BOT_TOKEN,
37 | in_memory=True,
38 | parse_mode=ParseMode.DEFAULT,
39 | )
40 |
41 | async def start(self):
42 | await super().start()
43 | self.id = self.me.id
44 | self.name = self.me.first_name + " " + (self.me.last_name or "")
45 | self.username = self.me.username
46 | self.mention = self.me.mention
47 | try:
48 | await self.resolve_peer(config.LOGGER_ID)
49 | await self.send_message(config.LOGGER_ID, f"๏ {self.mention} sᴛᴀʀᴛᴇᴅ ➛ \n\n๏ ɴᴀᴍᴇ ➛ {self.name}\n๏ ɪᴅ ➛ {self.id}\n๏ ᴜsᴇʀɴᴀᴍᴇ ➛ @{self.username} \n\n||ᴍᴀᴅᴇ ʙʏ ᴍᴜʀᴀʟɪ 🥀 ||")
50 | except:
51 | pass
52 |
53 | async def stop(self):
54 | await super().stop()
55 |
56 |
57 |
58 |
59 | Chiku = ChikuBot()
60 |
61 |
62 |
63 | #from AiChatBot.Db import git
64 |
65 | #Up = git()
66 |
67 |
--------------------------------------------------------------------------------
/AiChatBot/modules/Id.py:
--------------------------------------------------------------------------------
1 | from AiChatBot import Chiku
2 | from pyrogram import filters, client
3 | from pyrogram.enums import ParseMode
4 |
5 |
6 | @Chiku.on_cmd("id")
7 | async def getid(client, message):
8 | chat = message.chat
9 | your_id = message.from_user.id
10 | message_id = message.id
11 | reply = message.reply_to_message
12 |
13 | text = f"**[ᴍᴇssᴀɢᴇ ɪᴅ:]({message.link})** `{message_id}`\n"
14 | text += f"**[ʏᴏᴜʀ ɪᴅ:](tg://user?id={your_id})** `{your_id}`\n"
15 |
16 | if not message.command:
17 | message.command = message.text.split()
18 |
19 | if not message.command:
20 | message.command = message.text.split()
21 |
22 | if len(message.command) == 2:
23 | try:
24 | split = message.text.split(None, 1)[1].strip()
25 | user_id = (await client.get_users(split)).id
26 | text += f"**[ᴜsᴇʀ ɪᴅ:](tg://user?id={user_id})** `{user_id}`\n"
27 |
28 | except Exception:
29 | return await message.reply_text("ᴛʜɪs ᴜsᴇʀ ᴅᴏᴇsɴ'ᴛ ᴇxɪsᴛ.", quote=True)
30 |
31 | text += f"**[ᴄʜᴀᴛ ɪᴅ:](https://t.me/{chat.username})** `{chat.id}`\n\n"
32 |
33 | if (
34 | not getattr(reply, "empty", True)
35 | and not message.forward_from_chat
36 | and not reply.sender_chat
37 | ):
38 | text += f"**[ʀᴇᴘʟɪᴇᴅ ᴍᴇssᴀɢᴇ ɪᴅ:]({reply.link})** `{reply.id}`\n"
39 | text += f"**[ʀᴇᴘʟɪᴇᴅ ᴜsᴇʀ ɪᴅ:](tg://user?id={reply.from_user.id})** `{reply.from_user.id}`\n\n"
40 |
41 | if reply and reply.forward_from_chat:
42 | text += f"ᴛʜᴇ ғᴏʀᴡᴀʀᴅᴇᴅ ᴄʜᴀɴɴᴇʟ, {reply.forward_from_chat.title}, ʜᴀs ᴀɴ ɪᴅ ᴏғ `{reply.forward_from_chat.id}`\n\n"
43 | print(reply.forward_from_chat)
44 |
45 | if reply and reply.sender_chat:
46 | text += f"ɪᴅ ᴏғ ᴛʜᴇ ʀᴇᴘʟɪᴇᴅ ᴄʜᴀᴛ/ᴄʜᴀɴɴᴇʟ, ɪs `{reply.sender_chat.id}`"
47 | print(reply.sender_chat)
48 |
49 | await message.reply_text(
50 | text,
51 | disable_web_page_preview=True,
52 | parse_mode=ParseMode.DEFAULT,
53 | )
54 |
--------------------------------------------------------------------------------
/AiChatBot/modules/Telegraph.py:
--------------------------------------------------------------------------------
1 | import os
2 | from pyrogram import filters
3 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
4 | from telegraph import upload_file
5 | from AiChatBot import Chiku
6 |
7 | #credit - Vivek Kumar
8 |
9 | @Chiku.on_cmd(["tgm", "tgt", "telegraph", "tl"])
10 | async def get_link_group(client, message):
11 | if not message.reply_to_message:
12 | return await message.reply_text(
13 | "Pʟᴇᴀsᴇ ʀᴇᴘʟʏ ᴛᴏ ᴀ ᴍᴇᴅɪᴀ ᴛᴏ ᴜᴘʟᴏᴀᴅ ᴏɴ Tᴇʟᴇɢʀᴀᴘʜ"
14 | )
15 |
16 | media = message.reply_to_message
17 | file_size = 0
18 | if media.photo:
19 | file_size = media.photo.file_size
20 | elif media.video:
21 | file_size = media.video.file_size
22 | elif media.document:
23 | file_size = media.document.file_size
24 |
25 | if file_size > 5 * 1024 * 1024:
26 | return await message.reply_text("Pʟᴇᴀsᴇ ᴘʀᴏᴠɪᴅᴇ ᴀ ᴍᴇᴅɪᴀ ғɪʟᴇ ᴜɴᴅᴇʀ 𝟻MB.")
27 | try:
28 | text = await message.reply("Pʀᴏᴄᴇssɪɴɢ...")
29 |
30 | async def progress(current, total):
31 | await text.edit_text(f"📥 Dᴏᴡɴʟᴏᴀᴅɪɴɢ... {current * 100 / total:.1f}%")
32 |
33 | try:
34 | local_path = await media.download(progress=progress)
35 | await text.edit_text("📤Uᴘʟᴏᴀᴅɪɴɢ ᴛᴏ ᴛᴇʟᴇɢʀᴀᴘʜ...")
36 | upload_path = upload_file(local_path)
37 | await text.edit_text(
38 | f"🌐 | [ᴛᴇʟᴇɢʀᴀᴘʜ ʟɪɴᴋ](https://telegra.ph{upload_path[0]})",
39 | reply_markup=InlineKeyboardMarkup(
40 | [
41 | [
42 | InlineKeyboardButton(
43 | "ᴛᴇʟᴇɢʀᴀᴘʜ ʟɪɴᴋ",
44 | url=f"https://telegra.ph{upload_path[0]}",
45 | )
46 | ]
47 | ]
48 | ),
49 | )
50 | try:
51 | os.remove(local_path)
52 | except Exception:
53 | pass
54 | except Exception as e:
55 | await text.edit_text(f"❌ Fɪʟᴇ ᴜᴘʟᴏᴀᴅ ғᴀɪʟᴇᴅ\n\nRᴇᴀsᴏɴ: {e}")
56 | try:
57 | os.remove(local_path)
58 | except Exception:
59 | pass
60 | return
61 | except Exception:
62 | pass
--------------------------------------------------------------------------------
/AiChatBot/modules/Gcast.py:
--------------------------------------------------------------------------------
1 | from AiChatBot import Chiku
2 | import asyncio
3 | from pyrogram import filters
4 | from config import OWNER_ID
5 | from Murali import Owner
6 | from pyrogram.errors import FloodWait
7 | from AiChatBot.Db import get_served_chats, get_served_users
8 |
9 | @Chiku.on_cmd(["gcast", "broadcast"])
10 | async def broadcast_message(client, message):
11 | if message.from_user.id not in Owner and message.from_user.id not in OWNER_ID:
12 | return await message.reply_text(
13 | "»ʜᴇʜᴇ ᴏɴʟʏ ᴍʏ ᴏᴡɴᴇʀ ᴄᴀɴ ʙʀᴏᴀᴅᴄᴀsᴛ"
14 | )
15 |
16 | if message.reply_to_message:
17 | msg_id = message.reply_to_message.id
18 | query = None
19 | else:
20 | if len(message.command) < 2:
21 | return await message.reply_text(f"**Usage:**\n`/broadcast [message]` or reply to a message")
22 | query = message.text.split(None, 1)[1]
23 | if not query:
24 | return await message.reply_text("Please provide a message to broadcast.")
25 | msg_id = None
26 |
27 | sent_chats = 0
28 | chats = []
29 | schats = await get_served_chats()
30 | for chat in schats:
31 | chats.append(int(chat["chat_id"]))
32 | for chat_id in chats:
33 |
34 | try:
35 | if msg_id:
36 | await client.forward_messages(chat_id, message.chat.id, msg_id)
37 | else:
38 | await client.send_message(chat_id, text=query)
39 | sent_chats += 1
40 | except FloodWait as e:
41 | await asyncio.sleep(e.value)
42 | except Exception:
43 | continue
44 |
45 | await message.reply_text(f"Broadcasted message to {sent_chats} chats.")
46 |
47 | sent_users = 0
48 | users = []
49 | susers = await get_served_users()
50 | for user in susers:
51 | users.append(int(user["user_id"]))
52 | for user_id in users:
53 | try:
54 | if msg_id:
55 | await client.forward_messages(user_id, message.chat.id, msg_id)
56 | else:
57 | await client.send_message(user_id, text=query)
58 | sent_users += 1
59 | except FloodWait as e:
60 | await asyncio.sleep(e.value)
61 | except Exception:
62 | continue
63 |
64 | await message.reply_text(f"Broadcasted message to {sent_users} users.")
65 |
66 |
--------------------------------------------------------------------------------
/AiChatBot/Db/Updatefetcher:
--------------------------------------------------------------------------------
1 | import asyncio
2 | import shlex
3 | from typing import Tuple
4 | from git import Repo, Git
5 | from git.exc import GitCommandError, InvalidGitRepositoryError
6 | import os
7 | import config
8 |
9 |
10 | os.environ['GIT_PYTHON_GIT_EXECUTABLE'] = '/usr/bin/git'
11 |
12 | Git.refresh()
13 |
14 | def install_req(cmd: str) -> Tuple[str, str, int, int]:
15 | async def install_requirements():
16 | args = shlex.split(cmd)
17 | process = await asyncio.create_subprocess_exec(
18 | *args,
19 | stdout=asyncio.subprocess.PIPE,
20 | stderr=asyncio.subprocess.PIPE,
21 | )
22 | stdout, stderr = await process.communicate()
23 | return (
24 | stdout.decode("utf-8", "replace").strip(),
25 | stderr.decode("utf-8", "replace").strip(),
26 | process.returncode,
27 | process.pid,
28 | )
29 |
30 | return asyncio.get_event_loop().run_until_complete(install_requirements())
31 |
32 | def git():
33 | REPO_LINK = config.UPSTREAM_REPO
34 | if config.GIT_TOKEN:
35 | GIT_USERNAME = REPO_LINK.split("com/")[1].split("/")[0]
36 | TEMP_REPO = REPO_LINK.split("https://")[1]
37 | UPSTREAM_REPO = f"https://{GIT_USERNAME}:{config.GIT_TOKEN}@{TEMP_REPO}"
38 | else:
39 | UPSTREAM_REPO = config.UPSTREAM_REPO
40 | try:
41 | repo = Repo()
42 | except GitCommandError:
43 | print("Invalid Git Command")
44 | except InvalidGitRepositoryError:
45 | repo = Repo.init()
46 | if "origin" in repo.remotes:
47 | origin = repo.remote("origin")
48 | else:
49 | origin = repo.create_remote("origin", UPSTREAM_REPO)
50 | origin.fetch()
51 | repo.create_head(
52 | config.UPSTREAM_BRANCH,
53 | origin.refs[config.UPSTREAM_BRANCH],
54 | )
55 | repo.heads[config.UPSTREAM_BRANCH].set_tracking_branch(
56 | origin.refs[config.UPSTREAM_BRANCH]
57 | )
58 | repo.heads[config.UPSTREAM_BRANCH].checkout(True)
59 | try:
60 | repo.create_remote("origin", config.UPSTREAM_REPO)
61 | except BaseException:
62 | pass
63 | nrs = repo.remote("origin")
64 | nrs.fetch(config.UPSTREAM_BRANCH)
65 | try:
66 | nrs.pull(config.UPSTREAM_BRANCH)
67 | except GitCommandError:
68 | repo.git.reset("--hard", "FETCH_HEAD")
69 | install_req("pip3 install --no-cache-dir -r requirements.txt")
70 | print(f"𝐒𝐮𝐜𝐜𝐞𝐬𝐬𝐟𝐮𝐥𝐥𝐲 𝐅𝐞𝐭𝐜𝐡𝐞𝐝 𝐔𝐩𝐝𝐚𝐭𝐞𝐬 𝐅𝐫𝐨𝐦 𝐂𝐡𝐢𝐤𝐮 𝐁𝐨𝐭 💓.")
71 |
72 |
--------------------------------------------------------------------------------
/AiChatBot/modules/Groups.py:
--------------------------------------------------------------------------------
1 | from pyrogram import Client, filters
2 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
3 | from AiChatBot import Chiku as app
4 | from config import LOGGER_ID as LOG_GROUP_ID
5 | from AiChatBot.Db import get_served_chats, remove_served_chat, add_served_chat
6 |
7 | import requests
8 |
9 |
10 | @app.on_message(filters.new_chat_members, group=2)
11 | async def on_new_chat_members(client: Client, message: Message):
12 | if (await client.get_me()).id in [user.id for user in message.new_chat_members]:
13 | added_by = message.from_user.mention if message.from_user else "ᴜɴᴋɴᴏᴡɴ ᴜsᴇʀ"
14 |
15 | response = requests.get("https://nekos.best/api/v2/neko").json()
16 | image_url = response["results"][0]["url"]
17 | served_chats = len(await get_served_chats())
18 | chat_id = message.chat.id
19 | if message.chat.username:
20 | chatusername = f"{message.chat.username}"
21 | else:
22 | chatusername = await client.export_chat_invite_link(message.chat.id)
23 |
24 | msg = (
25 | f"❄️ ʙᴏᴛ #ᴀᴅᴅᴇᴅ ᴛᴏ ɴᴇᴡ ɢʀᴏᴜᴘ \n\n"
26 | f"┏━━━━━━━━━━━━━━━━━┓\n"
27 | f"┣★ **ᴄʜᴀᴛ** › : {message.chat.title}\n"
28 | f"┣★ **ᴄʜᴀᴛ ɪᴅ** › : {chat_id}\n"
29 | f"┣★ **ᴄʜᴀᴛ ᴜɴᴀᴍᴇ** › : @{message.chat.username}\n"
30 | f"┣★ **ɢʀᴏᴜᴘ ʟɪɴᴋ** › : [ᴛᴏᴜᴄʜ]({chatusername}) \n"
31 | # f"┣★ **ɢʀᴏᴜᴘ ᴍᴇᴍʙᴇʀs** › : {count}\n"
32 | f"┣★ **ᴛᴏᴛᴀʟ ᴄʜᴀᴛ** › : {served_chats}\n"
33 | f"┣★ **ᴀᴅᴅᴇᴅ ʙʏ** › : {added_by} \n"
34 | f"┗━━━━━━━━━★ "
35 | )
36 | await app.send_photo(LOG_GROUP_ID, photo=image_url, caption=msg)
37 |
38 | await add_served_chat(chat_id)
39 |
40 | @app.on_message(filters.left_chat_member)
41 | async def on_left_chat_member(_, message: Message):
42 | if (await app.get_me()).id == message.left_chat_member.id:
43 | remove_by = message.from_user.mention if message.from_user else "𝐔ɴᴋɴᴏᴡɴ 𝐔sᴇʀ"
44 | title = message.chat.title
45 | username = f"@{message.chat.username}" if message.chat.username else "𝐏ʀɪᴠᴀᴛᴇ 𝐂ʜᴀᴛ"
46 | response = requests.get("https://nekos.best/api/v2/neko").json()
47 | image_url = response["results"][0]["url"]
48 | chat_id = message.chat.id
49 | left = (
50 | f"❄️ ʙᴏᴛ #ʟᴇғᴛ_ɢʀᴏᴜᴘ \n\n"
51 | f"๏ ɢʀᴏᴜᴘ ɴᴀᴍᴇ ➠ {title}\n"
52 | f"๏ ɢʀᴏᴜᴘ ɪᴅ ➠ {chat_id}\n"
53 | f"๏ ʙᴏᴛ ʀᴇᴍᴏᴠᴇᴅ ʙʏ ➠ {remove_by}\n"
54 | )
55 | await app.send_photo(LOG_GROUP_ID, photo=image_url, caption=left)
56 | await remove_served_chat(chat_id)
57 |
58 |
--------------------------------------------------------------------------------
/AiChatBot/Strings/inline.py:
--------------------------------------------------------------------------------
1 | from AiChatBot import Chiku
2 | from config import OWNER_ID, SUPPORT_GROUP
3 | from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
4 | from typing import Union
5 |
6 |
7 | def small_caps(text):
8 | conversion = str.maketrans("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
9 | "ᴀʙᴄᴅᴇғɢʜɪᴊᴋʟᴍɴᴏᴘǫʀsᴛᴜᴠᴡxʏᴢᴀʙᴄᴅᴇғɢʜɪᴊᴋʟᴍɴᴏᴘǫʀsᴛᴜᴠᴡxʏᴢ")
10 | return text.translate(conversion)
11 |
12 |
13 |
14 | HELP_BUTTON = InlineKeyboardMarkup([
15 | [
16 | InlineKeyboardButton(text=small_caps("Afk"), callback_data="afk"),
17 | InlineKeyboardButton(text=small_caps("Alive"), callback_data="alive"),
18 | InlineKeyboardButton(text=small_caps("id"), callback_data="id")
19 | ],
20 | [
21 | InlineKeyboardButton(text=small_caps("ping"), callback_data="ping"),
22 | InlineKeyboardButton(text=small_caps("Chatbot"), callback_data="chatbott"),
23 | InlineKeyboardButton(text=small_caps("start"), callback_data="start")
24 | ],
25 | [
26 | InlineKeyboardButton(text=small_caps("Dev"), callback_data="dev"),
27 | InlineKeyboardButton(text=small_caps("T-Graph"), callback_data="telegraph"),
28 | InlineKeyboardButton(text=small_caps("Love"), callback_data="love")
29 | ],
30 | [
31 | InlineKeyboardButton(text=small_caps("Back"), callback_data="gotomain"),
32 | InlineKeyboardButton(text=small_caps("close"), callback_data="close"),
33 |
34 | ]
35 | ])
36 |
37 | INHELPBUTTON = InlineKeyboardMarkup([
38 | [
39 | InlineKeyboardButton(text=small_caps("Back"), callback_data="gohelp"),
40 | InlineKeyboardButton(text=small_caps("close"), callback_data="close"),
41 |
42 | ]
43 | ])
44 |
45 | def START_BUTTON(OWNER: Union[bool, int] = None):
46 | button = InlineKeyboardMarkup(
47 | [
48 | [
49 | InlineKeyboardButton(
50 | text="ᴀᴅᴅ ᴍᴇ ᴛᴏ ʏᴏᴜʀ ɢʀᴏᴜᴘ 💓",
51 | url=f"https://t.me/{Chiku.username}?startgroup=true",
52 | ),
53 | ],
54 | [
55 | InlineKeyboardButton(
56 | text="ʜᴇʟᴘ & ᴄᴏᴍᴍᴀɴᴅꜱ ",
57 | callback_data="gohelp",
58 | ),
59 | ],
60 | [
61 | InlineKeyboardButton(
62 | text="ᴅᴇᴠᴇʟᴏᴘᴇʀ ",
63 | user_id=OWNER,
64 | ),
65 | InlineKeyboardButton(
66 | text="ꜱᴜᴘᴘᴏʀᴛ",
67 | url=f"https://t.me/{SUPPORT_GROUP}",
68 | ),
69 | ],
70 | ]
71 | )
72 | return button
73 |
74 |
--------------------------------------------------------------------------------
/setup:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | pprint (){
4 | cred='\033[0;31m'
5 | cgreen='\033[0;32m'
6 | cyellow='\033[0;33m'
7 | cblue='\033[0;34m'
8 | cpurple='\033[0;35m'
9 | eval "export color='$cpurple'"
10 | [ ! -z $2 ] && eval "export color=\"\$$2\""
11 | printf "$color $1"
12 | }
13 |
14 | color_reset(){ printf '\033[0;37m';}
15 |
16 | yesnoprompt(){
17 | old_stty_cfg=$(stty -g)
18 | stty raw -echo ; answer=$(head -c 1)
19 | stty $old_stty_cfg
20 | echo "$answer" | grep -iq "^y"
21 | }
22 |
23 | update() {
24 | pprint "\n\nUpdating package list.. "
25 | sudo apt update 2>&1 | grep "can be upgraded" &>/dev/null
26 | if [ $? -eq 0 ]; then
27 | pprint "UPDATE AVAILABLE" "cgreen"
28 | pprint "\n\nDo you want to automatically upgrade (y/n)?"
29 | if yesnoprompt; then
30 | pprint "\n\nUpgrading packages.. "
31 | sudo apt upgrade -y &>/dev/null &&
32 | pprint "DONE!\n\n" "cgreen" || (pprint "FAIL.\n\n" "cred"; exit 1)
33 | else
34 | echo
35 | fi
36 | else
37 | pprint "ALREADY UP TO DATE\n\n" "cgreen"
38 | fi
39 | }
40 |
41 | packages(){
42 | if ! command -v pip &>/dev/null; then
43 | pprint "Couldn't found pip, installing now..."
44 | sudo apt install python3-pip -y 2>pypilog.txt 1>/dev/null &&
45 | pprint "SUCCESS.\n\n" "cgreen" || (pprint "FAIL.\n\n" "cred"; exit 1)
46 | fi
47 |
48 | if ! command -v ffmpeg &>/dev/null; then
49 | pprint "Couldn't found ffmpeg, installing now..."
50 | if sudo apt install ffmpeg -y &>/dev/null;then
51 | pprint "SUCCESS.\n\n" "cgreen"
52 | else
53 | pprint "FAIL.\n\n" "cred"
54 | pprint "You need to install ffmpeg manually in order to deploy YukkiMusic, exiting...\n" "cblue"
55 | exit 1
56 | fi
57 | fi
58 |
59 | # Check ffmpeg version and warn user if necessary.
60 | fv=$(grep -Po 'version (3.*?) ' <<< $(ffmpeg -version)) &&
61 | pprint "Playing live streams not going to work since you have ffmpeg $fv, live streams are supported by version 4+.\n" "cblue"
62 | }
63 |
64 |
65 |
66 | installation(){
67 | pprint "\n\nUpgrading pip and installing dependency packages..."
68 | pip3 install -U pip &>>pypilog.txt &&
69 | pip3 install -U -r requirements.txt &>>pypilog.txt &&
70 | pprint "DONE.\n" "cgreen" && return
71 | pprint "FAIL.\n" "cred"
72 | exit 1
73 | }
74 |
75 | clear
76 | pprint "Welcome to ChikuBot Setup Installer\n\n"
77 | pprint "If you see any error during Installation Process, Please refer to these files for logs: "
78 | pprint "\nFor node js errors , Checkout nodelog.txt"
79 | pprint "\nFor pypi packages errors , Checkout pypilog.txt"
80 | sleep 1
81 | pprint "\n\nScript needs sudo privileges in order to update & install packages.\n"
82 | sudo test
83 |
84 | update
85 | packages
86 | node
87 | installation
88 | pprint "\n\n\n\n\nChikuBot Installation Completed !" "cgreen"
89 | sleep 1
90 | clear
91 |
92 | pprint "\nEnter Your Values Below\n\n\n"
93 | pprint "API ID: "; color_reset; read api_id
94 | pprint "\nAPI HASH: "; color_reset; read api_hash
95 | pprint "\nBOT TOKEN: "; color_reset; read bot_token
96 | pprint "\nOWNER ID:"; color_reset; read ownid
97 | pprint "\nMONGO URL: "; color_reset; read mongo_url
98 |
99 |
100 | pprint "\n\nProcessing your vars, wait a while !" "cgreen"
101 |
102 | if [ -f .env ]; then
103 | rm .env
104 | fi
105 |
106 | echo """API_ID = $api_id
107 | API_HASH = $api_hash
108 | BOT_TOKEN = $bot_token
109 | MONGO_URL= $mongo_urk
110 | OWNER_ID = $ownid""" > .env
111 | clear
112 |
113 | pprint "\n\n\nThanks for using ChikuBot installer, your vars have been saved successfully ! \nIf you wanna add more variables add them in your env by : vi .env"
114 | pprint "\n\nNow you can start the bot by : bash start\n\n"
115 |
--------------------------------------------------------------------------------
/AiChatBot/modules/ChatBot.py:
--------------------------------------------------------------------------------
1 | from pyrogram import Client, filters, types, enums
2 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
3 | from motor.motor_asyncio import AsyncIOMotorClient
4 | import requests
5 | from config import *
6 | from AiChatBot.Db import add_served_user, add_served_chat, get_served_chats, get_served_users
7 | from AiChatBot import Chiku
8 | from pyrogram.enums import ChatAction, ChatType
9 |
10 | mongo_client = AsyncIOMotorClient(MONGO_URL)
11 | db = mongo_client.chikudatabass
12 | chatbotdatabase = db.cchikudarabase
13 |
14 | async def is_admin(chat_id: int, user_id: int) -> bool:
15 | member = await Chiku.get_chat_member(chat_id, user_id)
16 | return member.status in [enums.ChatMemberStatus.ADMINISTRATOR, enums.ChatMemberStatus.OWNER]
17 |
18 | @Chiku.on_message(filters.command("chatbot") & filters.group, group=6)
19 | async def chatbot_command(_, message: Message):
20 | if await is_admin(message.chat.id, message.from_user.id):
21 | response = requests.get("https://nekos.best/api/v2/neko").json()
22 | image_url = response["results"][0]["url"]
23 | keyboard = InlineKeyboardMarkup(
24 | [
25 | [
26 | InlineKeyboardButton(text="Eɴᴀʙʟᴇ", callback_data="enable_chatbot"),
27 | InlineKeyboardButton(text="Dɪsᴀʙʟᴇ", callback_data="disable_chatbot"),
28 | ]
29 | ]
30 | )
31 | await message.reply_photo(image_url, caption=f"ᴄʟɪᴄᴋ ʙᴇʟᴏᴡ ᴀɴʏ ʙᴜᴛᴛᴏɴ ᴛᴏ ᴇɴᴀʙʟᴇ ᴏʀ ᴅɪꜱᴀʙʟᴇ ᴄʜᴀᴛʙᴏᴛ ɪɴ {message.chat.title}", reply_markup=keyboard)
32 | else:
33 | await message.reply_text("ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ɪꜱ ᴏɴʟʏ ꜰᴏʀ ɢʀᴏᴜᴘ ᴀᴅᴍɪɴꜱ.", show_alert=True)
34 |
35 | @Chiku.on_callback_query(filters.regex(r"^(enable|disable)_chatbot$"))
36 | async def enable_disable_chatbot(_, query: types.CallbackQuery):
37 | chat_id = query.message.chat.id
38 | action = query.data
39 |
40 | if await is_admin(chat_id, query.from_user.id):
41 | if action == "enable_chatbot":
42 | if await chatbotdatabase.find_one({"chat_id": chat_id}):
43 | await query.answer("ᴄʜᴀᴛʙᴏᴛ ɪꜱ ᴀʟʀᴇᴀᴅʏ ᴇɴᴀʙʟᴇᴅ .", show_alert=True)
44 | else:
45 | await chatbotdatabase.insert_one({"chat_id": chat_id, "admin_id": query.from_user.id})
46 | await query.answer("ᴄʜᴀᴛʙᴏᴛ ᴇɴᴀʙʟᴇᴅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ !", show_alert=True)
47 | await query.message.edit_text(f"ᴄʜᴀᴛʙᴏᴛ ᴇɴᴀʙʟᴇᴅ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ʙʏ {query.from_user.mention()}")
48 | else:
49 | chatbot_info = await chatbotdatabase.find_one({"chat_id": chat_id})
50 | if chatbot_info:
51 | await chatbotdatabase.delete_one({"chat_id": chat_id})
52 | await query.answer("ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴅᴇꜱᴀʙʟᴇᴅ ᴄʜᴀᴛʙᴏᴛ !", show_alert=True)
53 | await query.message.edit_text(f"ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴅᴇꜱᴀʙʟᴇᴅ ᴄʜᴀᴛʙᴏᴛ ʙʏ {query.from_user.mention()}")
54 | else:
55 | await query.answer("ᴍᴀᴋᴇ ꜱᴜʀᴇ ʏᴏᴜ ᴀʟʀᴇᴀᴅʏ ᴇɴᴀʙʟᴇᴅ ᴄʜᴀᴛʙᴏᴛ .", show_alert=True)
56 | else:
57 | await query.answer("ᴛʜɪꜱ ᴄᴏᴍᴍᴀɴᴅ ɪꜱ ᴏɴʟʏ ꜰᴏʀ ɢʀᴏᴜᴘ ᴀᴅᴍɪɴꜱ.", show_alert=True)
58 |
59 | @Chiku.on_message(
60 | (filters.text & ~filters.bot), group=4
61 | )
62 | async def chatbottexts(client, message):
63 | user_id = message.from_user.id
64 | user_message = message.text
65 | if message.chat.type == ChatType.PRIVATE:
66 | api_url = f"http://api.brainshop.ai/get?bid=181999&key=BTx5oIaCq8Cqut3S&uid={user_id}&msg={user_message}"
67 | response = requests.get(api_url).json()["cnt"]
68 | await message.reply_text(response)
69 | else:
70 | if (message.reply_to_message and message.reply_to_message.from_user.is_self) or not message.reply_to_message:
71 | chatbot_info = await chatbotdatabase.find_one({"chat_id": message.chat.id})
72 | if chatbot_info:
73 | try:
74 | api_url = f"http://api.brainshop.ai/get?bid=181999&key=BTx5oIaCq8Cqut3S&uid={user_id}&msg={user_message}"
75 | response = requests.get(api_url).json()["cnt"]
76 | await client.send_chat_action(message.chat.id, ChatAction.TYPING)
77 | await message.reply_text(response)
78 | except Exception as e:
79 | print(f"An error occurred in group chat bot: {str(e)}")
80 | pass
81 |
--------------------------------------------------------------------------------
/AiChatBot/Strings/callbacks.py:
--------------------------------------------------------------------------------
1 | from pyrogram.types import CallbackQuery
2 | from AiChatBot import Chiku
3 | from AiChatBot.Strings import *
4 | from pyrogram.enums import ChatType
5 | import requests
6 | from config import OWNER_ID
7 | from pyrogram import filters
8 |
9 | @Chiku.on_callback_query(filters.regex("gohelp"))
10 | async def help_panel(client, callback_query: CallbackQuery):
11 | try:
12 | await callback_query.edit_message_text(f"ᴡᴇʟᴄᴏᴍᴇ ᴛᴏ ᴛʜᴇ ʜᴇʟᴘ ꜱᴇᴄᴛɪᴏɴ ᴏꜰ {Chiku.mention}", reply_markup=HELP_BUTTON)
13 | except Exception as e:
14 | print(f"An error occurred while editing the HELP message: {e}")
15 |
16 | @Chiku.on_callback_query(filters.regex("gotomain"))
17 | async def gotomain(client, callback_query: CallbackQuery):
18 | try:
19 | await Chiku.resolve_peer(OWNER_ID[0])
20 | OWNER = OWNER_ID[0]
21 | except:
22 | OWNER = OWNER_ID[0]
23 | M = START_BUTTON(OWNER)
24 | try:
25 | await callback_query.edit_message_text(START_TEXT.format(callback_query.from_user.mention, Chiku.mention), reply_markup=M)
26 | except Exception as e:
27 | print(f"An error occurred while editing the HELP message: {e}")
28 |
29 | @Chiku.on_callback_query(filters.regex("afk"))
30 | async def afk(client, callback_query: CallbackQuery):
31 | try:
32 | if callback_query.message.chat.type in (ChatType.PRIVATE, ChatType.SUPERGROUP):
33 | await callback_query.edit_message_text(TEXT1, reply_markup=INHELPBUTTON)
34 | except Exception as e:
35 | print(f"An error occurred while editing the message: {e}")
36 |
37 | @Chiku.on_callback_query(filters.regex("alive"))
38 | async def alive(client, callback_query: CallbackQuery):
39 | try:
40 | if callback_query.message.chat.type in (ChatType.PRIVATE, ChatType.SUPERGROUP):
41 | await callback_query.edit_message_text(TEXT2, reply_markup=INHELPBUTTON)
42 | except Exception as e:
43 | print(f"An error occurred while editing the message: {e}")
44 |
45 | @Chiku.on_callback_query(filters.regex("id"))
46 | async def iddd(client, callback_query: CallbackQuery):
47 | try:
48 | if callback_query.message.chat.type in (ChatType.PRIVATE, ChatType.SUPERGROUP):
49 | await callback_query.edit_message_text(TEXT3, reply_markup=INHELPBUTTON)
50 | except Exception as e:
51 | print(f"An error occurred while editing the message: {e}")
52 |
53 | @Chiku.on_callback_query(filters.regex("ping"))
54 | async def pinghh(client, callback_query: CallbackQuery):
55 | try:
56 | if callback_query.message.chat.type in (ChatType.PRIVATE, ChatType.SUPERGROUP):
57 | await callback_query.edit_message_text(TEXT4, reply_markup=INHELPBUTTON)
58 | except Exception as e:
59 | print(f"An error occurred while editing the message: {e}")
60 |
61 | @Chiku.on_callback_query(filters.regex("chatbott"))
62 | async def chatbott(client, callback_query: CallbackQuery):
63 | try:
64 | if callback_query.message.chat.type in (ChatType.PRIVATE, ChatType.SUPERGROUP):
65 | await callback_query.edit_message_text(TEXT5, reply_markup=INHELPBUTTON)
66 | except Exception as e:
67 | print(f"An error occurred while editing the message: {e}")
68 |
69 | @Chiku.on_callback_query(filters.regex("start"))
70 | async def strt(client, callback_query: CallbackQuery):
71 | try:
72 | if callback_query.message.chat.type in (ChatType.PRIVATE, ChatType.SUPERGROUP):
73 | await callback_query.edit_message_text(TEXT6, reply_markup=INHELPBUTTON)
74 | except Exception as e:
75 | print(f"An error occurred while editing the message: {e}")
76 |
77 | @Chiku.on_callback_query(filters.regex("dev"))
78 | async def devel(client, callback_query: CallbackQuery):
79 | try:
80 | if callback_query.message.chat.type in (ChatType.PRIVATE, ChatType.SUPERGROUP):
81 | await callback_query.edit_message_text(TEXT7, reply_markup=INHELPBUTTON)
82 | except Exception as e:
83 | print(f"An error occurred while editing the message: {e}")
84 |
85 | @Chiku.on_callback_query(filters.regex("telegraph"))
86 | async def telegraph(client, callback_query: CallbackQuery):
87 | try:
88 | if callback_query.message.chat.type in (ChatType.PRIVATE, ChatType.SUPERGROUP):
89 | await callback_query.edit_message_text(TEXT8, reply_markup=INHELPBUTTON)
90 | except Exception as e:
91 | print(f"An error occurred while editing the message: {e}")
92 |
93 | @Chiku.on_callback_query(filters.regex("love"))
94 | async def love(client, callback_query: CallbackQuery):
95 | try:
96 | if callback_query.message.chat.type in (ChatType.PRIVATE, ChatType.SUPERGROUP):
97 | await callback_query.edit_message_text(TEXT9, reply_markup=INHELPBUTTON)
98 | except Exception as e:
99 | print(f"An error occurred while editing the message: {e}")
100 |
101 | @Chiku.on_callback_query(filters.regex("close"))
102 | async def close(client, callback_query: CallbackQuery):
103 | await callback_query.message.delete()
104 |
105 |
--------------------------------------------------------------------------------
/AiChatBot/modules/Start.py:
--------------------------------------------------------------------------------
1 | from AiChatBot import Chiku
2 | from pyrogram import Client, filters
3 | from AiChatBot.Db import get_served_chats, get_served_users, add_served_user, add_served_chat
4 | import requests
5 | from Murali import Owner
6 | from pyrogram.enums import ChatType
7 | import random
8 | from config import OWNER_ID, LOGGER_ID
9 | import asyncio
10 | from AiChatBot.Strings import HELP_BUTTON, START_TEXT, START_BUTTON
11 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, CallbackQuery
12 |
13 | EMOJIOS = [
14 | "💣", "💥", "🪄", "🎋", "✨", "🦹", "🌺", "🍀", "💞", "🎁", "💌", "🧨", "⚡", "🤡", "👻",
15 | "🎃", "🎩", "🕊", "🍭", "🐻", "🦄", "🐼", "🐰", "🌸", "🌈", "🌟", "🌼", "🐱", "🐶", "🐨",
16 | "🐥", "🎮", "🎵", "📚", "🎨", "☕", "🍕", "🍦", "🍰", "🎈", "🎉", "🐤", "🍬"
17 | ]
18 |
19 | STICKER = [
20 | "CAACAgUAAx0CfAEyWgAClxdl9Gg4N-HyCImjGFXOQSHz50MD9wACzgoAAgrrYVWxPZWXGNr8SjQE",
21 | "CAACAgUAAx0CfAEyWgAClx1l9Gh9PHZKDIw8qbacmxzRD1QNAAOcDQAC0YVxVQijiuf_CF8_NAQ",
22 | "CAACAgUAAx0CfAEyWgAClyJl9Giplzk45LHa3SWbl30VQud5sgACJAgAAkemgVWsjZK8lbezvDQE",
23 | "CAACAgUAAx0CfAEyWgACmzZl-DHnr2MOLOPp34onib6dzUFjZgACQAgAApt6iFXzn_VE52urQDQE",
24 | "CAACAgUAAx0CfAEyWgAClydl9GjEpP5YDBYtPn-g8aC55Mmw_wACyQwAApDeqFbZJHowNnvidjQE",
25 | "CAACAgUAAx0CbEz78AABAQsvZfP2vNspUQkhtlqbZvDVUTvtIeIAApwNAALRhXFVCKOK5_8IXz8eBA",
26 | "CAACAgUAAx0CffjZyQACKoZmInOTHCv5lfpO580Y_UPEeUveYAAClAgAAspLwVT1oL4z_bhK7x4E",
27 | "CAACAgUAAx0CffjZyQACKo5mInRgNfyhH-Y3tKwKyj4_RoKu9gACsgYAAtAF2VYY6HZG8DUiyh4E",
28 | "CAACAgUAAx0CffjZyQACKoVmInNNz2YqgVIOm0b_XNASdarg0QAC9QkAAlTOgFSpIzlJ8dofZR4E",
29 | "CAACAgUAAx0CffjZyQACKohmInOZTlDo3YUTGWNdt1-8QFvrhQACqgwAArC9oFRVcuyU8PCqFR4E",
30 | "CAACAgUAAx0CffjZyQACKopmInPJwawFfy9z96S23cRxc5iI3QACegsAAtFEoVSKNlWkZeVvBh4E",
31 | "CAACAgUAAx0CffjZyQACKodmInOY37YoG7I-Mn9VbHbcE1VkYgACWAcAAmF4oFRci8T1o_XfEh4E",
32 | "CAACAgUAAx0CffjZyQACKotmInP5P_GvgKU67nB3ZXDU5UHdwQACBAkAAmGTqFTyMEUMwHr2WB4E",
33 | "CAACAgUAAx0CfAEyWgAClyxl9GkdhdvG8gmelpuDDXW43GdyYgACDAkAAgYmmVWwda82o5ssVx4E",
34 | "CAACAgQAAx0CfAEyWgACly9l9GoPSnyCro7QrrIPDIMl0VJNvAACKAwAArq5EFDBJa4kfYMtSB4E",
35 | "CAACAgUAAx0CfAEyWgAClzJl9Gphz8y2LOZXS_g4SBfUPQwAAeIAAs0EAAISTXlWi28Xpyv5nuUeBA"
36 | ]
37 |
38 | PHOTOS = [
39 | "https://telegra.ph/file/018d6002a0ad3aee739f4.jpg",
40 | "https://telegra.ph/file/9d1b413d24ef703e931e3.jpg",
41 | "https://telegra.ph/file/035f1b9835c47f45952f7.jpg",
42 | "https://telegra.ph/file/ca93aeef2e7b45918b668.jpg",
43 | "https://telegra.ph/file/be64889b9a092f05bb51e.jpg",
44 | "https://telegra.ph/file/b75e6977d0fa2d5d78b0f.jpg",
45 | "https://telegra.ph/file/7a07ef4fd40ad2eb20c35.jpg",
46 | "https://telegra.ph/file/cc7adb01901d0e3d2ed3c.jpg",
47 | "https://telegra.ph/file/38e76bbfb4666757186f1.jpg",
48 | "https://telegra.ph/file/602b29a89fca3129194be.jpg",
49 | "https://telegra.ph/file/71d6213be9255750453a6.jpg",
50 | "https://telegra.ph/file/7576d27e926a634add7f4.jpg",
51 | "https://telegra.ph/file/c15485da3d83eb47ad0ff.jpg",
52 | "https://telegra.ph/file/2c46895723d637de84918.jpg",
53 | "https://telegra.ph/file/148858c4837e90c9cae49.jpg",
54 | "https://telegra.ph/file/aa5556e11d949e5f095c5.jpg",
55 | "https://telegra.ph/file/dd4479290dc8aecd5ed26.jpg",
56 | "https://telegra.ph/file/7226a80d33f1d9e9051a4.jpg",
57 | "https://telegra.ph/file/903078ebee2327f8a433c.jpg",
58 | "https://telegra.ph/file/f5e17db4530f3afb7df29.jpg",
59 | "https://telegra.ph/file/d104ea00a4f5d5a2bd6bd.jpg",
60 | "https://telegra.ph/file/e30c70f101f19dac328c6.jpg",
61 | "https://telegra.ph/file/9dbab97d92fefb83ffb83.jpg",
62 | "https://telegra.ph/file/574377193d0ac413757a4.jpg",
63 | "https://telegra.ph/file/704ef3c97af1163689206.jpg",
64 | "https://telegra.ph/file/18bb7adf017c4566f17bf.jpg",
65 | "https://telegra.ph/file/eeb95340c7f1b6548f4e2.jpg",
66 | "https://telegra.ph/file/b6c7cee4bb3767c59ab54.jpg",
67 | "https://telegra.ph/file/e8d502afc144e77d81c48.jpg"
68 | ]
69 |
70 | @Chiku.on_cmd("start")
71 | async def startbot(client, message):
72 | try:
73 | await Chiku.resolve_peer(OWNER_ID[0])
74 | OWNER = OWNER_ID[0]
75 | except:
76 | OWNER = OWNER_ID[0]
77 |
78 | imgg = await message.reply_photo(photo=random.choice(PHOTOS))
79 | await asyncio.sleep(0.001)
80 | await imgg.edit_caption(f"Hᴇʟʟᴏ {message.from_user.mention}")
81 | await asyncio.sleep(0.0001)
82 | Ahh = await message.reply_text(text=random.choice(EMOJIOS))
83 | await asyncio.sleep(0.0001)
84 | await Ahh.delete()
85 | jj = await message.reply_sticker(random.choice(STICKER))
86 | await asyncio.sleep(0.0001)
87 | await jj.delete()
88 | let = await message.reply_text("ʟᴇᴛ ᴍᴇ sᴛᴀʀᴛ")
89 | await asyncio.sleep(0.002)
90 | await let.edit("ʟᴇᴛ ᴍᴇ sᴛᴀʀᴛ......")
91 | await imgg.delete()
92 | STT = await message.reply_sticker(random.choice(STICKER))
93 | await asyncio.sleep(0.0001)
94 | fff = await message.reply_sticker(random.choice(STICKER))
95 | await STT.delete()
96 | await asyncio.sleep(0.001)
97 | await let.delete()
98 | Hlo = await message.reply_sticker(random.choice(STICKER))
99 | await asyncio.sleep(0.0001)
100 | await Hlo.delete()
101 |
102 | M = START_BUTTON(OWNER)
103 | response = requests.get("https://nekos.best/api/v2/neko").json()
104 | image_url = response["results"][0]["url"]
105 | await message.reply_photo(
106 | image_url,
107 | caption=START_TEXT.format(message.from_user.mention, Chiku.mention),
108 | reply_markup=M,
109 | )
110 | await fff.delete()
111 | try:
112 | if message.chat.type == ChatType.PRIVATE:
113 | await add_served_user(message.from_user.id)
114 | else:
115 | await add_served_chat(message.chat.id)
116 | except:
117 | pass
118 | await Chiku.send_message(LOGGER_ID, f"ꜱᴏᴍᴇᴏɴᴇ ᴊᴜꜱᴛ ꜱᴛᴀʀᴛᴇᴅ {Chiku.mention}\n\nɴᴀᴍᴇ - {message.from_user.mention}\nɪᴅ - {message.from_user.id}\nᴜꜱᴇʀɴᴀᴍᴇ - @{message.from_user.username}")
119 |
120 |
121 | @Chiku.on_cmd("stats")
122 | async def statsbot(client, message):
123 | if message.from_user.id not in Owner and message.from_user.id not in OWNER_ID:
124 | return
125 |
126 | response = requests.get("https://nekos.best/api/v2/neko").json()
127 | m = response["results"][0]["url"]
128 | users = len(await get_served_users())
129 | chats = len(await get_served_chats())
130 | await message.reply_photo(
131 | photo=m,
132 | caption=f"""ʜᴇʀᴇ ɪꜱ ᴛʜᴇ ᴛᴏᴛᴀʟ ꜱᴛᴀᴛꜱ ᴏꜰ {Chiku.mention}:
133 |
134 | ➻ ᴄʜᴀᴛs : {chats}
135 | ➻ ᴜsᴇʀs : {users}
136 | """
137 | )
138 |
139 |
--------------------------------------------------------------------------------
/AiChatBot/modules/Eval.py:
--------------------------------------------------------------------------------
1 | import os
2 | import re
3 | import subprocess
4 | import sys
5 | import asyncio
6 | import traceback
7 | from inspect import getfullargspec
8 | from io import StringIO
9 | from Murali import Owner
10 | from time import time
11 | from pyrogram import filters
12 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
13 | from AiChatBot import Chiku
14 | from config import OWNER_ID
15 |
16 |
17 | async def aexec(code, client, message):
18 | exec(
19 | "async def __aexec(client, message): "
20 | + "".join(f"\n {a}" for a in code.split("\n"))
21 | )
22 | return await locals()["__aexec"](client, message)
23 |
24 |
25 | async def edit_or_reply(msg: Message, **kwargs):
26 | func = msg.edit_text if msg.from_user.is_self else msg.reply
27 | spec = getfullargspec(func.__wrapped__).args
28 | await func(**{k: v for k, v in kwargs.items() if k in spec})
29 |
30 |
31 | @Chiku.on_edited_message(
32 | filters.command("Murali")
33 | & filters.user(Owner)
34 | & ~filters.forwarded
35 | & ~filters.via_bot,
36 | group=6
37 | )
38 | @Chiku.on_message(
39 | filters.command("Murali")
40 | & filters.user(Owner)
41 | & ~filters.forwarded
42 | & ~filters.via_bot,
43 | group=6
44 | )
45 | async def executor(client: Chiku, message: Message):
46 | if len(message.command) < 2:
47 | return await edit_or_reply(message, text="ᴡʜᴀᴛ ʏᴏᴜ ᴡᴀɴɴᴀ ᴇxᴇᴄᴜᴛᴇ ?")
48 | try:
49 | cmd = message.text.split(" ", maxsplit=1)[1]
50 | except IndexError:
51 | return await message.delete()
52 | t1 = time()
53 | old_stderr = sys.stderr
54 | old_stdout = sys.stdout
55 | redirected_output = sys.stdout = StringIO()
56 | redirected_error = sys.stderr = StringIO()
57 | stdout, stderr, exc = None, None, None
58 | try:
59 | await aexec(cmd, client, message)
60 | except Exception:
61 | exc = traceback.format_exc()
62 | stdout = redirected_output.getvalue()
63 | stderr = redirected_error.getvalue()
64 | sys.stdout = old_stdout
65 | sys.stderr = old_stderr
66 | evaluation = "\n"
67 | if exc:
68 | evaluation += exc
69 | elif stderr:
70 | evaluation += stderr
71 | elif stdout:
72 | evaluation += stdout
73 | else:
74 | evaluation += "Success"
75 | final_output = f"⥤ ʀᴇsᴜʟᴛ :\n{evaluation}"
76 | if len(final_output) > 4096:
77 | filename = "output.txt"
78 | with open(filename, "w+", encoding="utf8") as out_file:
79 | out_file.write(str(evaluation))
80 | t2 = time()
81 | keyboard = InlineKeyboardMarkup(
82 | [
83 | [
84 | InlineKeyboardButton(
85 | text="⏳",
86 | callback_data=f"runtime {t2-t1} Seconds",
87 | )
88 | ]
89 | ]
90 | )
91 | await message.reply_document(
92 | document=filename,
93 | caption=f"⥤ ᴇᴠᴀʟ :\n{cmd[0:980]}\n\n⥤ ʀᴇsᴜʟᴛ :\nAttached Document",
94 | quote=False,
95 | reply_markup=keyboard,
96 | )
97 | await message.delete()
98 | os.remove(filename)
99 | else:
100 | t2 = time()
101 | keyboard = InlineKeyboardMarkup(
102 | [
103 | [
104 | InlineKeyboardButton(
105 | text="⏳",
106 | callback_data=f"runtime {round(t2-t1, 3)} Seconds",
107 | ),
108 | InlineKeyboardButton(
109 | text="🗑",
110 | callback_data=f"forceclose abc|{message.from_user.id}",
111 | ),
112 | ]
113 | ]
114 | )
115 | await edit_or_reply(message, text=final_output, reply_markup=keyboard)
116 |
117 |
118 | @Chiku.on_callback_query(filters.regex(r"runtime"))
119 | async def runtime_func_cq(_, cq):
120 | runtime = cq.data.split(None, 1)[1]
121 | await cq.answer(runtime, show_alert=True)
122 |
123 |
124 | @Chiku.on_callback_query(filters.regex("forceclose"))
125 | async def forceclose_command(_, CallbackQuery):
126 | callback_data = CallbackQuery.data.strip()
127 | callback_request = callback_data.split(None, 1)[1]
128 | query, user_id = callback_request.split("|")
129 | if CallbackQuery.from_user.id != int(user_id):
130 | try:
131 | return await CallbackQuery.answer(
132 | "» ɪᴛ'ʟʟ ʙᴇ ʙᴇᴛᴛᴇʀ ɪғ ʏᴏᴜ sᴛᴀʏ ɪɴ ʏᴏᴜʀ ʟɪᴍɪᴛs ", show_alert=True
133 | )
134 | except:
135 | return
136 | await CallbackQuery.message.delete()
137 | try:
138 | await CallbackQuery.answer()
139 | except:
140 | return
141 |
142 |
143 | @Chiku.on_edited_message(
144 | filters.command("shh")
145 | & filters.user(Owner)
146 | & ~filters.forwarded
147 | & ~filters.via_bot,
148 | group=6
149 | )
150 | @Chiku.on_message(
151 | filters.command("shh")
152 | & filters.user(Owner)
153 | & ~filters.forwarded
154 | & ~filters.via_bot,
155 | group=6
156 | )
157 | async def shellrunner(_, message: Message):
158 | if len(message.command) < 2:
159 | return await edit_or_reply(message, text="ᴇxᴀᴍᴩʟᴇ :\n/sh git pull")
160 | text = message.text.split(None, 1)[1]
161 | if "\n" in text:
162 | code = text.split("\n")
163 | output = ""
164 | for x in code:
165 | shell = re.split(""" (?=(?:[^'"]|'[^']*'|"[^"]*")*$)""", x)
166 | try:
167 | process = subprocess.Popen(
168 | shell,
169 | stdout=subprocess.PIPE,
170 | stderr=subprocess.PIPE,
171 | )
172 | except Exception as err:
173 | await edit_or_reply(message, text=f"ERROR :\n{err}")
174 | output += f"{code}\n"
175 | output += process.stdout.read()[:-1].decode("utf-8")
176 | output += "\n"
177 | else:
178 | shell = re.split(""" (?=(?:[^'"]|'[^']*'|"[^"]*")*$)""", text)
179 | for a in range(len(shell)):
180 | shell[a] = shell[a].replace('"', "")
181 | try:
182 | process = subprocess.Popen(
183 | shell,
184 | stdout=subprocess.PIPE,
185 | stderr=subprocess.PIPE,
186 | )
187 | except Exception as err:
188 | print(err)
189 | exc_type, exc_obj, exc_tb = sys.exc_info()
190 | errors = traceback.format_exception(
191 | etype=exc_type,
192 | value=exc_obj,
193 | tb=exc_tb,
194 | )
195 | return await edit_or_reply(
196 | message, text=f"ERROR :\n{''.join(errors)}"
197 | )
198 | output = process.stdout.read()[:-1].decode("utf-8")
199 | if str(output) == "\n":
200 | output = None
201 | if output:
202 | if len(output) > 4096:
203 | with open("output.txt", "w+") as file:
204 | file.write(output)
205 | await Chiku.send_document(
206 | message.chat.id,
207 | "output.txt",
208 | reply_to_message_id=message.id,
209 | caption="Output",
210 | )
211 | return os.remove("output.txt")
212 | await edit_or_reply(message, text=f"OUTPUT :\n{output}")
213 | else:
214 | await edit_or_reply(message, text="OUTPUT :\nNone")
215 | await message.stop_propagation()
216 |
217 |
--------------------------------------------------------------------------------
/AiChatBot/modules/Afk.py:
--------------------------------------------------------------------------------
1 | import time, re
2 | from pyrogram.enums import MessageEntityType
3 | from pyrogram import filters
4 | from pyrogram.types import Message
5 | from AiChatBot import Chiku as app
6 | from AiChatBot.Db.Afkdb import add_afk, is_afk, remove_afk
7 |
8 | BOT_USERNAME = app.username
9 |
10 | def get_readable_time(seconds: int) -> str:
11 | count = 0
12 | readable_time = ""
13 | time_list = []
14 | time_suffix_list = ["s", "ᴍ", "ʜ", "ᴅᴀʏs"]
15 |
16 | while count < 4:
17 | count += 1
18 | remainder, result = divmod(seconds, 60) if count < 3 else divmod(seconds, 24)
19 | if seconds == 0 and remainder == 0:
20 | break
21 | time_list.append(int(result))
22 | seconds = int(remainder)
23 |
24 | for x in range(len(time_list)):
25 | time_list[x] = str(time_list[x]) + time_suffix_list[x]
26 | if len(time_list) == 4:
27 | readable_time += time_list.pop() + ", "
28 |
29 | time_list.reverse()
30 | readable_time += ":".join(time_list)
31 |
32 | return readable_time
33 |
34 | @app.on_cmd(["afk", "brb"])
35 | async def active_afk(_, message: Message):
36 | if message.sender_chat:
37 | return
38 | user_id = message.from_user.id
39 | verifier, reasondb = await is_afk(user_id)
40 | if verifier:
41 | await remove_afk(user_id)
42 | try:
43 | afktype = reasondb["type"]
44 | timeafk = reasondb["time"]
45 | data = reasondb["data"]
46 | reasonafk = reasondb["reason"]
47 | seenago = get_readable_time((int(time.time() - timeafk)))
48 | if afktype == "text":
49 | send = await message.reply_text(
50 | f"**{message.from_user.first_name}** ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ ᴀɴᴅ ᴡᴀs ᴀᴡᴀʏ ғᴏʀ {seenago}",
51 | disable_web_page_preview=True,
52 | )
53 | if afktype == "text_reason":
54 | send = await message.reply_text(
55 | f"**{message.from_user.first_name}** ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ ᴀɴᴅ ᴡᴀs ᴀᴡᴀʏ ғᴏʀ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`",
56 | disable_web_page_preview=True,
57 | )
58 | if afktype == "animation":
59 | if str(reasonafk) == "None":
60 | send = await message.reply_animation(
61 | data,
62 | caption=f"**{message.from_user.first_name}** ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ ᴀɴᴅ ᴡᴀs ᴀᴡᴀʏ ғᴏʀ {seenago}",
63 | )
64 | else:
65 | send = await message.reply_animation(
66 | data,
67 | caption=f"**{message.from_user.first_name}** ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ ᴀɴᴅ ᴡᴀs ᴀᴡᴀʏ ғᴏʀ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`",
68 | )
69 | if afktype == "photo":
70 | if str(reasonafk) == "None":
71 | send = await message.reply_photo(
72 | photo=f"downloads/{user_id}.jpg",
73 | caption=f"**{message.from_user.first_name}** ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ ᴀɴᴅ ᴡᴀs ᴀᴡᴀʏ ғᴏʀ {seenago}",
74 | )
75 | else:
76 | send = await message.reply_photo(
77 | photo=f"downloads/{user_id}.jpg",
78 | caption=f"**{message.from_user.first_name}** ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ ᴀɴᴅ ᴡᴀs ᴀᴡᴀʏ ғᴏʀ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`",
79 | )
80 | except Exception:
81 | send = await message.reply_text(
82 | f"**{message.from_user.first_name}** ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ",
83 | disable_web_page_preview=True,
84 | )
85 |
86 | if len(message.command) == 1 and not message.reply_to_message:
87 | details = {
88 | "type": "text",
89 | "time": time.time(),
90 | "data": None,
91 | "reason": None,
92 | }
93 | elif len(message.command) > 1 and not message.reply_to_message:
94 | _reason = (message.text.split(None, 1)[1].strip())[:100]
95 | details = {
96 | "type": "text_reason",
97 | "time": time.time(),
98 | "data": None,
99 | "reason": _reason,
100 | }
101 | elif len(message.command) == 1 and message.reply_to_message.animation:
102 | _data = message.reply_to_message.animation.file_id
103 | details = {
104 | "type": "animation",
105 | "time": time.time(),
106 | "data": _data,
107 | "reason": None,
108 | }
109 | elif len(message.command) > 1 and message.reply_to_message.animation:
110 | _data = message.reply_to_message.animation.file_id
111 | _reason = (message.text.split(None, 1)[1].strip())[:100]
112 | details = {
113 | "type": "animation",
114 | "time": time.time(),
115 | "data": _data,
116 | "reason": _reason,
117 | }
118 | elif len(message.command) == 1 and message.reply_to_message.photo:
119 | await app.download_media(
120 | message.reply_to_message, file_name=f"{user_id}.jpg"
121 | )
122 | details = {
123 | "type": "photo",
124 | "time": time.time(),
125 | "data": None,
126 | "reason": None,
127 | }
128 | elif len(message.command) > 1 and message.reply_to_message.photo:
129 | await app.download_media(
130 | message.reply_to_message, file_name=f"{user_id}.jpg"
131 | )
132 | _reason = message.text.split(None, 1)[1].strip()
133 | details = {
134 | "type": "photo",
135 | "time": time.time(),
136 | "data": None,
137 | "reason": _reason,
138 | }
139 | elif len(message.command) == 1 and message.reply_to_message.sticker:
140 | if message.reply_to_message.sticker.is_animated:
141 | details = {
142 | "type": "text",
143 | "time": time.time(),
144 | "data": None,
145 | "reason": None,
146 | }
147 | else:
148 | await app.download_media(
149 | message.reply_to_message, file_name=f"{user_id}.jpg"
150 | )
151 | details = {
152 | "type": "photo",
153 | "time": time.time(),
154 | "data": None,
155 | "reason": None,
156 | }
157 | elif len(message.command) > 1 and message.reply_to_message.sticker:
158 | _reason = (message.text.split(None, 1)[1].strip())[:100]
159 | if message.reply_to_message.sticker.is_animated:
160 | details = {
161 | "type": "text_reason",
162 | "time": time.time(),
163 | "data": None,
164 | "reason": _reason,
165 | }
166 | else:
167 | await app.download_media(
168 | message.reply_to_message, file_name=f"{user_id}.jpg"
169 | )
170 | details = {
171 | "type": "photo",
172 | "time": time.time(),
173 | "data": None,
174 | "reason": _reason,
175 | }
176 | else:
177 | details = {
178 | "type": "text",
179 | "time": time.time(),
180 | "data": None,
181 | "reason": None,
182 | }
183 |
184 | await add_afk(user_id, details)
185 | await message.reply_text(f"{message.from_user.first_name} ɪs ɴᴏᴡ ᴀғᴋ!")
186 |
187 |
188 |
189 |
190 | chat_watcher_group = 1
191 |
192 |
193 | @app.on_message(
194 | ~filters.me & ~filters.bot & ~filters.via_bot,
195 | group=chat_watcher_group,
196 | )
197 | async def chat_watcher_func(_, message):
198 | if message.sender_chat:
199 | return
200 | userid = message.from_user.id
201 | user_name = message.from_user.first_name
202 | if message.entities:
203 | possible = ["/afk", f"/afk@{BOT_USERNAME}"]
204 | message_text = message.text or message.caption
205 | for entity in message.entities:
206 | if entity.type == MessageEntityType.BOT_COMMAND:
207 | if (message_text[0 : 0 + entity.length]).lower() in possible:
208 | return
209 |
210 | msg = ""
211 | replied_user_id = 0
212 |
213 |
214 |
215 | verifier, reasondb = await is_afk(userid)
216 | if verifier:
217 | await remove_afk(userid)
218 | try:
219 | afktype = reasondb["type"]
220 | timeafk = reasondb["time"]
221 | data = reasondb["data"]
222 | reasonafk = reasondb["reason"]
223 | seenago = get_readable_time((int(time.time() - timeafk)))
224 | if afktype == "text":
225 | msg += f"**{user_name}** ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ ᴀɴᴅ ᴡᴀs ᴀᴡᴀʏ ғᴏʀ {seenago}\n\n"
226 | if afktype == "text_reason":
227 | msg += f"**{user_name}** ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ ᴀɴᴅ ᴡᴀs ᴀᴡᴀʏ ғᴏʀ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`\n\n"
228 | if afktype == "animation":
229 | if str(reasonafk) == "None":
230 | send = await message.reply_animation(
231 | data,
232 | caption=f"**{user_name}** ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ ᴀɴᴅ ᴡᴀs ᴀᴡᴀʏ ғᴏʀ {seenago}\n\n",
233 | )
234 | else:
235 | send = await message.reply_animation(
236 | data,
237 | caption=f"**{user_name}** ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ ᴀɴᴅ ᴡᴀs ᴀᴡᴀʏ ғᴏʀ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`\n\n",
238 | )
239 | if afktype == "photo":
240 | if str(reasonafk) == "None":
241 | send = await message.reply_photo(
242 | photo=f"downloads/{userid}.jpg",
243 | caption=f"**{user_name}** ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ ᴀɴᴅ ᴡᴀs ᴀᴡᴀʏ ғᴏʀ {seenago}\n\n",
244 | )
245 | else:
246 | send = await message.reply_photo(
247 | photo=f"downloads/{userid}.jpg",
248 | caption=f"**{user_name[:25]}** ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ ᴀɴᴅ ᴡᴀs ᴀᴡᴀʏ ғᴏʀ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`\n\n",
249 | )
250 | except:
251 | msg += f"**{user_name[:25]}** ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ\n\n"
252 |
253 |
254 | if message.reply_to_message:
255 | try:
256 | replied_first_name = message.reply_to_message.from_user.first_name
257 | replied_user_id = message.reply_to_message.from_user.id
258 | verifier, reasondb = await is_afk(replied_user_id)
259 | if verifier:
260 | try:
261 | afktype = reasondb["type"]
262 | timeafk = reasondb["time"]
263 | data = reasondb["data"]
264 | reasonafk = reasondb["reason"]
265 | seenago = get_readable_time((int(time.time() - timeafk)))
266 | if afktype == "text":
267 | msg += (
268 | f"**{replied_first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\n"
269 | )
270 | if afktype == "text_reason":
271 | msg += f"**{replied_first_name[:25]}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`\n\n"
272 | if afktype == "animation":
273 | if str(reasonafk) == "None":
274 | send = await message.reply_animation(
275 | data,
276 | caption=f"**{replied_first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\n",
277 | )
278 | else:
279 | send = await message.reply_animation(
280 | data,
281 | caption=f"**{replied_first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`\n\n",
282 | )
283 | if afktype == "photo":
284 | if str(reasonafk) == "None":
285 | send = await message.reply_photo(
286 | photo=f"downloads/{replied_user_id}.jpg",
287 | caption=f"**{replied_first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\n",
288 | )
289 | else:
290 | send = await message.reply_photo(
291 | photo=f"downloads/{replied_user_id}.jpg",
292 | caption=f"**{replied_first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`\n\n",
293 | )
294 | except Exception:
295 | msg += f"**{replied_first_name}** ɪs ᴀғᴋ\n"
296 | except:
297 | pass
298 |
299 | if message.entities:
300 | entity = message.entities
301 | j = 0
302 | for x in range(len(entity)):
303 | if (entity[j].type) == MessageEntityType.MENTION:
304 | found = re.findall("@([_0-9a-zA-Z]+)", message.text)
305 | try:
306 | get_user = found[j]
307 | user = await app.get_users(get_user)
308 | if user.id == replied_user_id:
309 | j += 1
310 | continue
311 | except:
312 | j += 1
313 | continue
314 | verifier, reasondb = await is_afk(user.id)
315 | if verifier:
316 | try:
317 | afktype = reasondb["type"]
318 | timeafk = reasondb["time"]
319 | data = reasondb["data"]
320 | reasonafk = reasondb["reason"]
321 | seenago = get_readable_time((int(time.time() - timeafk)))
322 | if afktype == "text":
323 | msg += (
324 | f"**{user.first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\n"
325 | )
326 | if afktype == "text_reason":
327 | msg += f"**{user.first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`\n\n"
328 | if afktype == "animation":
329 | if str(reasonafk) == "None":
330 | send = await message.reply_animation(
331 | data,
332 | caption=f"**{user.first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\n",
333 | )
334 | else:
335 | send = await message.reply_animation(
336 | data,
337 | caption=f"**{user.first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`\n\n",
338 | )
339 | if afktype == "photo":
340 | if str(reasonafk) == "None":
341 | send = await message.reply_photo(
342 | photo=f"downloads/{user.id}.jpg",
343 | caption=f"**{user.first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\n",
344 | )
345 | else:
346 | send = await message.reply_photo(
347 | photo=f"downloads/{user.id}.jpg",
348 | caption=f"**{user.first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`\n\n",
349 | )
350 | except:
351 | msg += f"**{user.first_name[:25]}** ɪs ᴀғᴋ\n\n"
352 | elif (entity[j].type) == MessageEntityType.TEXT_MENTION:
353 | try:
354 | user_id = entity[j].user.id
355 | if user_id == replied_user_id:
356 | j += 1
357 | continue
358 | first_name = entity[j].user.first_name
359 | except:
360 | j += 1
361 | continue
362 | verifier, reasondb = await is_afk(user_id)
363 | if verifier:
364 | try:
365 | afktype = reasondb["type"]
366 | timeafk = reasondb["time"]
367 | data = reasondb["data"]
368 | reasonafk = reasondb["reason"]
369 | seenago = get_readable_time((int(time.time() - timeafk)))
370 | if afktype == "text":
371 | msg += f"**{first_name}** is ᴀғᴋ sɪɴᴄᴇ {seenago}\n\n"
372 | if afktype == "text_reason":
373 | msg += f"**{first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`\n\n"
374 | if afktype == "animation":
375 | if str(reasonafk) == "None":
376 | send = await message.reply_animation(
377 | data,
378 | caption=f"**{first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\n",
379 | )
380 | else:
381 | send = await message.reply_animation(
382 | data,
383 | caption=f"**{first_name}** ɪs AFK sɪɴᴄᴇ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`\n\n",
384 | )
385 | if afktype == "photo":
386 | if str(reasonafk) == "None":
387 | send = await message.reply_photo(
388 | photo=f"downloads/{user_id}.jpg",
389 | caption=f"**{first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\n",
390 | )
391 | else:
392 | send = await message.reply_photo(
393 | photo=f"downloads/{user_id}.jpg",
394 | caption=f"**{first_name}** ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\nʀᴇᴀsᴏɴ: `{reasonafk}`\n\n",
395 | )
396 | except:
397 | msg += f"**{first_name}** ɪs ᴀғᴋ\n\n"
398 | j += 1
399 | if msg != "":
400 | try:
401 | send = await message.reply_text(msg, disable_web_page_preview=True)
402 | except:
403 | return
404 |
--------------------------------------------------------------------------------