# --------------------------------------------------------------------------------- #░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█ #░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█ #░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀ # Name: ID # Description: Tool for ID's # Author: @codrago_m # --------------------------------------------------------------------------------- # 🔒 Licensed under the GNU AGPLv3 # 🌐 https://www.gnu.org/licenses/agpl-3.0.html # --------------------------------------------------------------------------------- # Author: @codrago # Commands: id, chatid, userid # scope: hikka_only # meta developer: @codrago_m # meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png # meta pic: https://envs.sh/HJX.webp # --------------------------------------------------------------------------------- __version__ = (1, 0, 0) from .. import loader, utils import telethon as tl @loader.tds class ID(loader.Module): """ID of all!""" strings = { "name": "ID", "Error_reply": "✖️ Where your reply?", "not_chat": "✖️ This is not a chat!" } strings_ru = { "Error_reply": "✖️ Где твой реплай?", "not_chat": "✖️ Это не чат!" } def __init__(self): self.config = loader.ModuleConfig( loader.ConfigValue( "bot_api_id", "True", "Bot API id for channels and chats", validator=loader.validators.Boolean(), ), ) async def useridcmd(self, message): """[reply or username] | Get User ID""" args = utils.get_args_raw(message) reply = await message.get_reply_message() try: if args: user = await message.client.get_entity( args if not args.isdigit() else int(args) ) else: user = await message.client.get_entity(reply.sender_id) except ValueError: user = await message.client.get_entity(message.sender_id) if isinstance(user, tl.types.User): await utils.answer(message, f"🪐 {user.first_name}\n😴 User ID: {user.id}") elif self.config["bot_api_id"] == True: await utils.answer(message, f"🪐 {user.title}\n😴 User ID: -100{user.id}") else: await utils.answer(message, f"🪐 {user.title}\n😴 User ID: {user.id}") async def idcmd(self, message): """| Get your ID""" user = await message.client.get_entity(message.sender_id) await utils.answer(message, f"🪐 Your Nick: {user.first_name}\n😴 Your ID: {message.sender_id}") async def chatidcmd(self, message): """| Get chat ID""" if self.config["bot_api_id"] == True: await utils.answer(message, f"🪐 {message.chat.title}\n😴 Chat ID: -100{message.peer_id.channel_id}") else: await utils.answer(message, f"🪐 {message.chat.title}\n😴 Chat ID: {message.peer_id.channel_id}")