Ufoptg's picture
Upload 93 files
78b07ad verified
raw
history blame
17.6 kB
import random
from pyrogram import Client
from pyrogram.enums import ChatMembersFilter, ChatMemberStatus
from pyrogram.types import Message
from Hellbot.functions.media import get_media_fileid
from Hellbot.functions.templates import chat_info_templates
from . import HelpMenu, group_n_channel, hellbot, on_message
kickme_quotes = [
"โœŒ๏ธ ๐–ฎ๐—Ž๐—๐—๐–บ ๐—๐–พ๐—‹๐–พ, ๐—…๐–พ๐–บ๐—๐—‚๐—‡๐—€ ๐—๐—๐–พ ๐—Œ๐—๐–บ๐—€๐–พ ๐—๐—ˆ ๐—๐—๐–พ ๐—‹๐–พ๐–บ๐—… ๐—Œ๐—๐–บ๐—‹๐—Œ!",
"๐Ÿš€ ๐–ค๐—…๐–พ๐—๐–บ๐—๐—‚๐—‡๐—€ ๐—†๐—’ ๐—๐—‚๐–ป๐–พ๐—Œ, ๐—…๐–พ๐–บ๐—๐—‚๐—‡๐—€ ๐—๐—๐–พ ๐–ผ๐—๐–บ๐— ๐—‚๐—‡ ๐—Œ๐—๐—’๐—…๐–พ.",
"๐Ÿ•Š๏ธ ๐–ฅ๐—…๐—’๐—‚๐—‡๐—€ ๐—Œ๐—ˆ๐—…๐—ˆ, ๐–พ๐—‘๐—‚๐—๐—‚๐—‡๐—€ ๐—๐—๐—‚๐—Œ ๐—€๐—‹๐—ˆ๐—Ž๐—‰ ๐—€๐—‹๐–บ๐–ผ๐–พ๐–ฟ๐—Ž๐—…๐—…๐—’.",
"๐ŸŒช๏ธ ๐–ฒ๐—๐—‚๐—‹๐—‹๐—‚๐—‡๐—€ ๐—Ž๐—‰ ๐—๐—๐–พ ๐—๐—‚๐—‡๐–ฝ๐—Œ ๐—ˆ๐–ฟ ๐–ฝ๐–พ๐—‰๐–บ๐—‹๐—๐—Ž๐—‹๐–พ, ๐–ป๐—’๐–พ!",
"๐Ÿšถโ€โ™‚๏ธ ๐–ถ๐–บ๐—…๐—„๐—‚๐—‡๐—€ ๐–บ๐—๐–บ๐—’ ๐—…๐—‚๐—„๐–พ ๐–บ ๐–ป๐—ˆ๐—Œ๐—Œ, ๐—Œ๐–พ๐–พ ๐—’๐—ˆ๐—Ž ๐—‡๐–พ๐—๐–พ๐—‹!",
"๐Ÿ”ฅ ๐–ก๐—Ž๐—‹๐—‡๐—‚๐—‡๐—€ ๐–ป๐—‹๐—‚๐–ฝ๐—€๐–พ๐—Œ ๐–บ๐—‡๐–ฝ ๐–ผ๐—‹๐–พ๐–บ๐—๐—‚๐—‡๐—€ ๐—†๐—’ ๐—ˆ๐—๐—‡ ๐—‰๐–บ๐—๐—. ๐– ๐–ฝ๐—‚๐—ˆ๐—Œ!",
"๐Ÿ’ซ ๐–ณ๐—Ž๐—‹๐—‡๐—‚๐—‡๐—€ ๐—๐—๐–พ ๐—‰๐–บ๐—€๐–พ ๐–บ๐—‡๐–ฝ ๐–ผ๐—…๐—ˆ๐—Œ๐—‚๐—‡๐—€ ๐—๐—๐—‚๐—Œ ๐–ผ๐—๐–บ๐—‰๐—๐–พ๐—‹.",
"๐Ÿ‘‘ ๐–ข๐—‹๐—ˆ๐—๐—‡'๐—Œ ๐—๐—ˆ๐—ˆ ๐—๐–พ๐–บ๐—๐—’ ๐–ฟ๐—ˆ๐—‹ ๐—๐—๐—‚๐—Œ ๐–ผ๐—๐–บ๐—. ๐–จ'๐—† ๐—ˆ๐—Ž๐—!",
"๐Ÿƒโ€โ™‚๏ธ ๐–ฒ๐—‰๐—‹๐—‚๐—‡๐—๐—‚๐—‡๐—€ ๐—ˆ๐—Ž๐— ๐—ˆ๐–ฟ ๐—๐–พ๐—‹๐–พ ๐—๐—‚๐—๐— ๐–ฟ๐—…๐–บ๐—‚๐—‹. ๐–ข๐–บ๐—๐–ผ๐— ๐—’๐—ˆ๐—Ž ๐—‡๐–พ๐—๐–พ๐—‹!",
"๐Ÿšค ๐–ฒ๐–บ๐—‚๐—…๐—‚๐—‡๐—€ ๐–บ๐—๐–บ๐—’ ๐–ฟ๐—‹๐—ˆ๐—† ๐—๐—๐—‚๐—Œ ๐—€๐—‹๐—ˆ๐—Ž๐—‰ ๐–ผ๐—๐–บ๐—, ๐—Œ๐—†๐—ˆ๐—ˆ๐—๐— ๐—Œ๐–พ๐–บ๐—Œ ๐–บ๐—๐–พ๐–บ๐–ฝ!",
"๐Ÿƒ ๐–ซ๐—‚๐—„๐–พ ๐–บ ๐—…๐–พ๐–บ๐–ฟ ๐—‚๐—‡ ๐—๐—๐–พ ๐—๐—‚๐—‡๐–ฝ, ๐–จ'๐—† ๐–ฝ๐—‹๐—‚๐–ฟ๐—๐—‚๐—‡๐—€ ๐–บ๐—๐–บ๐—’. ๐–ฅ๐–บ๐—‹๐–พ๐—๐–พ๐—…๐—…!",
"๐Ÿ›ซ ๐–ณ๐–บ๐—„๐—‚๐—‡๐—€ ๐—ˆ๐–ฟ๐–ฟ ๐–ฟ๐—‹๐—ˆ๐—† ๐—๐—๐—‚๐—Œ ๐–ผ๐—๐–บ๐— ๐—‹๐—Ž๐—‡๐—๐–บ๐—’. ๐–ก๐—ˆ๐—‡ ๐—๐—ˆ๐—’๐–บ๐—€๐–พ!",
"๐Ÿ’ผ ๐–ข๐—…๐—ˆ๐—Œ๐—‚๐—‡๐—€ ๐—๐—๐–พ ๐–ป๐—‹๐—‚๐–พ๐–ฟ๐–ผ๐–บ๐—Œ๐–พ ๐—ˆ๐—‡ ๐—๐—๐—‚๐—Œ ๐–ผ๐—๐–บ๐—. ๐–ฏ๐—‹๐—ˆ๐–ฟ๐–พ๐—Œ๐—Œ๐—‚๐—ˆ๐—‡๐–บ๐—… ๐–พ๐—‘๐—‚๐—!",
"๐ŸŽญ ๐–ค๐—‘๐—‚๐—๐—‚๐—‡๐—€ ๐—๐—๐–พ ๐—Œ๐—๐–บ๐—€๐–พ ๐—๐—‚๐—๐— ๐–บ ๐–ฝ๐—‹๐–บ๐—†๐–บ๐—๐—‚๐–ผ ๐–ฟ๐—…๐–บ๐—‚๐—‹. ๐–ณ๐–บ-๐–ฝ๐–บ!",
"๐ŸŽถ ๐–ฏ๐—…๐–บ๐—’๐—‚๐—‡๐—€ ๐—†๐—’ ๐–พ๐—‘๐—‚๐— ๐—†๐—Ž๐—Œ๐—‚๐–ผ. ๐–ข๐—Ž๐–พ ๐—๐—๐–พ ๐–ฟ๐–บ๐—‹๐–พ๐—๐–พ๐—…๐—… ๐—Œ๐—’๐—†๐—‰๐—๐—ˆ๐—‡๐—’!",
"๐Ÿ•ถ๏ธ ๐–ฅ๐–บ๐–ฝ๐—‚๐—‡๐—€ ๐—‚๐—‡๐—๐—ˆ ๐—๐—๐–พ ๐—Œ๐—๐–บ๐–ฝ๐—ˆ๐—๐—Œ, ๐—…๐–พ๐–บ๐—๐—‚๐—‡๐—€ ๐–บ๐—‡ ๐–บ๐—‚๐—‹ ๐—ˆ๐–ฟ ๐—†๐—’๐—Œ๐—๐–พ๐—‹๐—’.",
"๐Ÿšช ๐–ข๐—…๐—ˆ๐—Œ๐—‚๐—‡๐—€ ๐—๐—๐–พ ๐–ฝ๐—ˆ๐—ˆ๐—‹ ๐—Š๐—Ž๐—‚๐–พ๐—๐—…๐—’ ๐—ˆ๐—‡ ๐—๐—๐—‚๐—Œ ๐–ผ๐—๐–บ๐—. ๐–ค๐—‘๐—‚๐— ๐–ผ๐—ˆ๐—†๐—‰๐—…๐–พ๐—๐–พ!",
"๐Ÿ”’ ๐–ซ๐—ˆ๐–ผ๐—„๐—‚๐—‡๐—€ ๐—๐—๐–พ ๐–ผ๐—๐–บ๐— ๐–ป๐–พ๐—๐—‚๐—‡๐–ฝ ๐—†๐–พ. ๐–ช๐–พ๐–พ๐—‰ ๐—‚๐— ๐—Œ๐—๐—’๐—…๐—‚๐—Œ๐—, ๐–ฟ๐—ˆ๐—…๐—„๐—Œ!",
"๐ŸŒŒ ๐–ต๐–บ๐—‡๐—‚๐—Œ๐—๐—‚๐—‡๐—€ ๐—‚๐—‡๐—๐—ˆ ๐—๐—๐–พ ๐–ผ๐—ˆ๐—Œ๐—†๐—‚๐–ผ ๐–บ๐–ป๐—’๐—Œ๐—Œ. ๐–ฒ๐–พ๐–พ ๐—’๐—ˆ๐—Ž ๐—‚๐—‡ ๐—๐—๐–พ ๐—Œ๐—๐–บ๐—‹๐—Œ!",
"๐Ÿ’” ๐–ก๐—‹๐–พ๐–บ๐—„๐—‚๐—‡๐—€ ๐–ฟ๐—‹๐–พ๐–พ ๐–ฟ๐—‹๐—ˆ๐—† ๐—๐—๐—‚๐—Œ ๐–ผ๐—๐–บ๐—. ๐–ด๐—‡๐—…๐–พ๐–บ๐—Œ๐—๐—‚๐—‡๐—€ ๐—†๐—’ ๐—Œ๐—ˆ๐—…๐—ˆ ๐—ƒ๐—ˆ๐—Ž๐—‹๐—‡๐–พ๐—’!",
"๐Ÿ‘‘ ๐–ค๐—‘๐—‚๐—๐—‚๐—‡๐—€ ๐—€๐—‹๐–บ๐–ผ๐–พ๐–ฟ๐—Ž๐—…๐—…๐—’. ๐–ณ๐—๐—‚๐—Œ ๐–ผ๐—๐–บ๐— ๐–ผ๐—ˆ๐—Ž๐—…๐–ฝ๐—‡'๐— ๐—๐–บ๐—‡๐–ฝ๐—…๐–พ ๐—†๐—’ ๐—Œ๐—๐—’๐—…๐–พ.",
"๐Ÿš€ ๐–ณ๐—‚๐—†๐–พ ๐–ฟ๐—ˆ๐—‹ ๐—†๐–พ ๐—๐—ˆ ๐–ป๐—…๐–บ๐—Œ๐— ๐—ˆ๐–ฟ๐–ฟ. ๐– ๐–ฝ๐—‚๐—ˆ๐—Œ, ๐–บ๐—†๐—‚๐—€๐—ˆ๐—Œ!",
"๐ŸŒช๏ธ ๐–ฒ๐—๐—‚๐—‹๐—‹๐—‚๐—‡๐—€ ๐—Ž๐—‰ ๐—๐—๐–พ ๐–ฝ๐—‹๐–บ๐—†๐–บ ๐–บ๐—‡๐–ฝ ๐—†๐–บ๐—„๐—‚๐—‡๐—€ ๐—†๐—’ ๐–พ๐—‘๐—‚๐—.",
]
@on_message(
"setgpic",
chat_type=group_n_channel,
admin_only=True,
allow_stan=True,
)
async def setgpic(_, message: Message):
if not message.reply_to_message or not message.reply_to_message.photo:
return await hellbot.delete(
message, "๐–ฑ๐–พ๐—‰๐—…๐—’ ๐—๐—ˆ ๐–บ ๐—‰๐—๐—ˆ๐—๐—ˆ ๐—๐—ˆ ๐—Œ๐–พ๐— ๐–บ๐—Œ ๐—€๐—‹๐—ˆ๐—Ž๐—‰ ๐—‰๐—‹๐—ˆ๐–ฟ๐—‚๐—…๐–พ ๐—‰๐—‚๐–ผ๐—๐—Ž๐—‹๐–พ."
)
status = await message.chat.set_photo(photo=message.reply_to_message.photo.file_id)
if not status:
return await hellbot.delete(message, "๐–ฒ๐—ˆ๐—‹๐—‹๐—’, ๐—Œ๐—ˆ๐—†๐–พ๐—๐—๐—‚๐—‡๐—€ ๐—๐–พ๐—‡๐— ๐—๐—‹๐—ˆ๐—‡๐—€.")
await hellbot.delete(message, "๐–ฒ๐—Ž๐–ผ๐–ผ๐–พ๐—Œ๐—Œ๐–ฟ๐—Ž๐—…๐—…๐—’ ๐—Œ๐–พ๐— ๐—€๐—‹๐—ˆ๐—Ž๐—‰ ๐—‰๐—‹๐—ˆ๐–ฟ๐—‚๐—…๐–พ ๐—‰๐—‚๐–ผ๐—๐—Ž๐—‹๐–พ.")
await hellbot.check_and_log(
"setgpic",
f"**Group Profile Picture**\n\n**Group:** `{message.chat.title}`\n**Group ID:** `{message.chat.id}`\n**Admin:** `{message.from_user.mention}`",
)
@on_message(
"setgtitle",
chat_type=group_n_channel,
admin_only=True,
allow_stan=True,
)
async def setgtitle(_, message: Message):
if len(message.command) < 2:
return await hellbot.delete(
message, "๐–จ ๐—‡๐–พ๐–พ๐–ฝ ๐—Œ๐—ˆ๐—†๐–พ๐—๐—๐—‚๐—‡๐—€ ๐—๐—ˆ ๐—Œ๐–พ๐— ๐—๐—๐—‚๐—Œ ๐—€๐—‹๐—ˆ๐—Ž๐—‰ ๐—๐—‚๐—๐—…๐–พ."
)
prev_title = message.chat.title
new_title = await hellbot.input(message)
status = await message.chat.set_title(new_title)
if not status:
return await hellbot.delete(message, "๐–ฒ๐—ˆ๐—‹๐—‹๐—’, ๐—Œ๐—ˆ๐—†๐–พ๐—๐—๐—‚๐—‡๐—€ ๐—๐–พ๐—‡๐— ๐—๐—‹๐—ˆ๐—‡๐—€.")
await hellbot.delete(message, "๐–ฒ๐—Ž๐–ผ๐–ผ๐–พ๐—Œ๐—Œ๐–ฟ๐—Ž๐—…๐—…๐—’ ๐—Œ๐–พ๐— ๐—€๐—‹๐—ˆ๐—Ž๐—‰ ๐—๐—‚๐—๐—…๐–พ.")
await hellbot.check_and_log(
"setgtitle",
f"**Group Title**\n\n**Group:** `{prev_title}`\n**Group ID:** `{message.chat.id}`\n**Admin:** `{message.from_user.mention}`",
)
@on_message(
"setgabout",
chat_type=group_n_channel,
admin_only=True,
allow_stan=True,
)
async def setgabout(_, message: Message):
if len(message.command) < 2:
return await hellbot.delete(
message, "๐–จ ๐—‡๐–พ๐–พ๐–ฝ ๐—Œ๐—ˆ๐—†๐–พ๐—๐—๐—‚๐—‡๐—€ ๐—๐—ˆ ๐—Œ๐–พ๐— ๐—๐—๐—‚๐—Œ ๐—€๐—‹๐—ˆ๐—Ž๐—‰ ๐–บ๐–ป๐—ˆ๐—Ž๐—."
)
new_about = await hellbot.input(message)
status = await message.chat.set_description(new_about)
if not status:
return await hellbot.delete(message, "๐–ฒ๐—ˆ๐—‹๐—‹๐—’, ๐—Œ๐—ˆ๐—†๐–พ๐—๐—๐—‚๐—‡๐—€ ๐—๐–พ๐—‡๐— ๐—๐—‹๐—ˆ๐—‡๐—€.")
await hellbot.delete(message, "๐–ฒ๐—Ž๐–ผ๐–ผ๐–พ๐—Œ๐—Œ๐–ฟ๐—Ž๐—…๐—…๐—’ ๐—Œ๐–พ๐— ๐—€๐—‹๐—ˆ๐—Ž๐—‰ ๐–บ๐–ป๐—ˆ๐—Ž๐—.")
await hellbot.check_and_log(
"setgabout",
f"**Group About**\n\n**Group:** `{message.chat.title}`\n**Group ID:** `{message.chat.id}`\n**Admin:** `{message.from_user.mention}`",
)
@on_message(
"setgusername",
chat_type=group_n_channel,
admin_only=True,
allow_stan=True,
)
async def setgusername(client: Client, message: Message):
user_status = (await message.chat.get_member(message.from_user.id)).status
if user_status != ChatMemberStatus.OWNER:
return await hellbot.delete(message, "๐–จ ๐–บ๐—† ๐—‡๐—ˆ๐— ๐—๐—๐–พ ๐—ˆ๐—๐—‡๐–พ๐—‹ ๐—ˆ๐–ฟ ๐—๐—๐—‚๐—Œ ๐—€๐—‹๐—ˆ๐—Ž๐—‰.")
if len(message.command) < 2:
return await hellbot.delete(
message, "๐–จ ๐—‡๐–พ๐–พ๐–ฝ ๐—Œ๐—ˆ๐—†๐–พ๐—๐—๐—‚๐—‡๐—€ ๐—๐—ˆ ๐—Œ๐–พ๐— ๐—๐—๐—‚๐—Œ ๐—€๐—‹๐—ˆ๐—Ž๐—‰'๐—Œ ๐—Ž๐—Œ๐–พ๐—‹๐—‡๐–บ๐—†๐–พ."
)
new_username = await hellbot.input(message)
status = await client.set_chat_username(message.chat.id, new_username)
if not status:
return await hellbot.delete(message, "๐–ฒ๐—ˆ๐—‹๐—‹๐—’, ๐—Œ๐—ˆ๐—†๐–พ๐—๐—๐—‚๐—‡๐—€ ๐—๐–พ๐—‡๐— ๐—๐—‹๐—ˆ๐—‡๐—€.")
await hellbot.delete(message, "๐–ฒ๐—Ž๐–ผ๐–ผ๐–พ๐—Œ๐—Œ๐–ฟ๐—Ž๐—…๐—…๐—’ ๐—Œ๐–พ๐— ๐—€๐—‹๐—ˆ๐—Ž๐—‰ ๐—Ž๐—Œ๐–พ๐—‹๐—‡๐–บ๐—†๐–พ.")
await hellbot.check_and_log(
"setgusername",
f"**Group Username**\n\n**Group:** `{message.chat.title}`\n**Group ID:** `{message.chat.id}`\n**Admin:** `{message.from_user.mention}`",
)
@on_message(
"getglink",
chat_type=group_n_channel,
admin_only=True,
allow_stan=True,
)
async def getglink(_, message: Message):
link = await message.chat.export_invite_link()
await hellbot.delete(message, f"**๐–ฆ๐—‹๐—ˆ๐—Ž๐—‰ ๐—…๐—‚๐—‡๐—„:** `{link}`")
@on_message("kickme", chat_type=group_n_channel, allow_stan=True)
async def kickme(client: Client, message: Message):
hell = await hellbot.edit(message, random.choice(kickme_quotes))
try:
await client.leave_chat(message.chat.id)
except Exception as e:
return await hellbot.delete(
hell, f"Deym! Can't leave this chat.\n**Error:** `{e}`"
)
@on_message("newgroup", allow_stan=True)
async def new_group(client: Client, message: Message):
if len(message.command) < 2:
return await hellbot.delete(message, "๐–จ ๐—‡๐–พ๐–พ๐–ฝ ๐—Œ๐—ˆ๐—†๐–พ๐—๐—๐—‚๐—‡๐—€ ๐—๐—ˆ ๐—Œ๐–พ๐— ๐–บ๐—Œ ๐—€๐—‹๐—ˆ๐—Ž๐—‰ ๐—๐—‚๐—๐—…๐–พ.")
new_title = await hellbot.input(message)
try:
new_group = await client.create_group(new_title, hellbot.bot.me.id)
await hellbot.edit(
message, f"**๐–ฆ๐—‹๐—ˆ๐—Ž๐—‰ ๐—…๐—‚๐—‡๐—„:** [{new_group.title}]({new_group.invite_link})"
)
except Exception as e:
await hellbot.error(message, f"`{e}`", 20)
@on_message("newchannel", allow_stan=True)
async def new_channel(client: Client, message: Message):
if len(message.command) < 2:
return await hellbot.delete(
message, "๐–จ ๐—‡๐–พ๐–พ๐–ฝ ๐—Œ๐—ˆ๐—†๐–พ๐—๐—๐—‚๐—‡๐—€ ๐—๐—ˆ ๐—Œ๐–พ๐— ๐–บ๐—Œ ๐–ผ๐—๐–บ๐—‡๐—‡๐–พ๐—… ๐—๐—‚๐—๐—…๐–พ."
)
new_title = await hellbot.input(message)
try:
new_channel = await client.create_channel(new_title, "Created by HellBot")
await hellbot.edit(
message, f"**๐–ข๐—๐–บ๐—‡๐—‡๐–พ๐—… ๐—…๐—‚๐—‡๐—„:** [{new_channel.title}]({new_channel.username})"
)
except Exception as e:
await hellbot.error(message, f"`{e}`", 20)
@on_message("chatinfo", allow_stan=True)
async def chatInfo(client: Client, message: Message):
if len(message.command) > 1:
try:
chat = await client.get_chat(message.command[1])
except Exception as e:
return await hellbot.error(message, f"`{e}`")
else:
chat = message.chat
hell = await hellbot.edit(message, "Fetching chat info...")
if chat.invite_link:
chat_link = f"[Invite Link]({chat.invite_link})"
elif chat.username:
chat_link = f"@{chat.username}"
else:
chat_link = "Private Chat"
chat_owner = None
admins_count = 0
bots_count = 0
async for admin in client.get_chat_members(
chat.id, filter=ChatMembersFilter.ADMINISTRATORS
):
admins_count += 1
if admin.status == ChatMemberStatus.OWNER:
chat_owner = admin.user.mention
async for _ in client.get_chat_members(chat.id, filter=ChatMembersFilter.BOTS):
bots_count += 1
chat_info = await chat_info_templates(
chatName=chat.title,
chatId=chat.id,
chatLink=chat_link,
chatOwner=chat_owner,
dcId=chat.dc_id,
membersCount=chat.members_count,
adminsCount=admins_count,
botsCount=bots_count,
description=chat.description,
)
if chat.photo:
async for photo in client.get_chat_photos(chat.id, 1):
await hell.delete()
await client.send_photo(
message.chat.id,
photo.file_id,
caption=chat_info,
reply_to_message_id=message.id,
disable_notification=True,
)
return
else:
await hell.edit(chat_info, disable_web_page_preview=True)
@on_message("chatadmins", allow_stan=True)
async def chatAdmins(client: Client, message: Message):
if len(message.command) < 2:
chat = message.chat
else:
try:
chat = await client.get_chat(message.command[1])
except Exception as e:
return await hellbot.error(message, f"`{e}`")
hell = await hellbot.edit(message, "Fetching chat admins...")
admin_count = 0
admins = "**๐Ÿ’ซ ๐– ๐–ฝ๐—†๐—‚๐—‡๐—Œ ๐—‚๐—‡ ๐—๐—๐—‚๐—Œ ๐–ผ๐—๐–บ๐—:**\n\n"
async for admin in client.get_chat_members(
chat.id, filter=ChatMembersFilter.ADMINISTRATORS
):
admin_count += 1
admins += f"**{'0' if admin_count < 10 else ''}{admin_count}:** {admin.user.mention} - `{admin.status}`\n"
await hell.edit(admins, disable_web_page_preview=True)
@on_message("chatbots", allow_stan=True)
async def chatBots(client: Client, message: Message):
if len(message.command) < 2:
chat = message.chat
else:
try:
chat = await client.get_chat(message.command[1])
except Exception as e:
return await hellbot.error(message, f"`{e}`")
hell = await hellbot.edit(message, "Fetching chat bots...")
bot_count = 0
bots = "**๐Ÿค– ๐–ก๐—ˆ๐—๐—Œ ๐—‚๐—‡ ๐—๐—๐—‚๐—Œ ๐–ผ๐—๐–บ๐—:**\n\n"
async for bot in client.get_chat_members(chat.id, filter=ChatMembersFilter.BOTS):
bot_count += 1
bots += (
f"**{'0' if bot_count < 10 else ''}{bot_count}:** @{bot.user.username}\n"
)
await hell.edit(bots, disable_web_page_preview=True)
@on_message("id", allow_stan=True)
async def chatId(_, message: Message):
if message.reply_to_message:
msg = message.reply_to_message
else:
msg = message
hell = await hellbot.edit(message, "Fetching message info...")
info = f"**๐Ÿ’ซ ChatID:** `{msg.chat.id}`\n"
info += f"**๐Ÿชช MessageID:** `{msg.id}`\n\n"
if msg.from_user:
info += f"**๐Ÿ‘ค UserID:** `{msg.from_user.id}`\n\n"
if msg.forward_from:
info += f"**๐Ÿ‘ค Forwarded From:** `{msg.forward_from.id}`\n\n"
if msg.forward_from_chat:
info += f"**๐Ÿ’ซ Forwarded ChatID:** `{msg.forward_from_chat.id}`\n\n"
file_id = await get_media_fileid(msg)
if file_id:
info += f"**๐Ÿ“ FileID:** `{file_id}`\n\n"
await hell.edit(info, disable_web_page_preview=True)
@on_message("invite", allow_stan=True)
async def inviteUser(client: Client, message: Message):
if len(message.command) < 2:
return await hellbot.delete(
message, "I need a username/id to invite to this chat."
)
users = (await hellbot.input(message)).split(" ")
hell = await hellbot.edit(message, "Inviting users...")
resolved_users = await client.get_users(users)
await message.chat.add_members([user.id for user in resolved_users])
await hell.edit("Successfully invited users to this chat.")
HelpMenu("groups").add(
"setgpic", "<reply to photo>", "Set the group profile picture.", "setgpic"
).add("setgtitle", "<title>", "Set the group title.", "setgtitle chat group").add(
"setgabout",
"<text>",
"Set the group description/about",
"setgabout some group description",
).add(
"setgusername",
"<username>",
"Set the group username.",
"setgusername HellBot_Chats",
"Only group owners can use this command. Give username without '@'.",
).add(
"getglink", None, "Get the group invite link.", "getglink"
).add(
"kickme", None, "Leave the chat in swag ๐Ÿ˜Ž!", "kickme"
).add(
"newgroup", "<title>", "Create a new group.", "newgroup HellBot Group"
).add(
"newchannel", "<title>", "Create a new channel.", "newchannel HellBot Channel"
).add(
"chatinfo", "<chat id (optional)>", "Get info about the chat.", "chatinfo"
).add(
"chatadmins",
"<chat id (optional)>",
"Get the list of admins of mentioned chat.",
"chatadmins @Hellbot_Chats",
).add(
"chatbots",
"<chat id (optional)>",
"Get the list of bots of mentioned chat.",
"chatbots @Hellbot_Chats",
).add(
"id",
"<reply to message (optional)>",
"Get the ID of the replied message, replied user, and more.",
"id",
).add(
"invite",
"<username/id>",
"Invite the mentioned user to this chat.",
"invite @ForGo10God",
"You can invite multiple users by giving their username/id separated by space.",
).info(
"Group Menu"
).done()