AlexKrut

bot

Feb 19th, 2023 (edited)
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.37 KB | None | 0 0
  1. import io, inspect
  2. from .. import loader, utils
  3. from asyncio import sleep, gather
  4. from telethon.tl.types import Message
  5.  
  6. @loader.tds
  7. class OnlineMod(loader.Module):
  8.     """Описание модуля"""
  9.     strings = {
  10.         'name': 'OnlineBot',
  11.         }
  12.  
  13.  
  14.                            
  15.     async def client_ready(self, client, db):
  16.         self._client = client
  17.         self._db = db
  18.     async def blockcmd(self, message):
  19.         """Блокирование юзера в боте (.block причина)"""
  20.         args = utils.get_args_raw(message)
  21.         reply = await message.get_reply_message()
  22.         iduser = await utils.get_user(reply)
  23.         reason = args.split(' ', 2)[0]
  24.         await message.edit(f'Юзер {iduser.id} успешно заблокирован')
  25.         await message.client.send_message(6138860884, f'/block {iduser.id} {reason}')
  26.     async def unblockcmd(self, message):
  27.         """Разблокирование юзера в боте (.unblock причина)"""
  28.         args = utils.get_args_raw(message)
  29.         reply = await message.get_reply_message()
  30.         iduser = await utils.get_user(reply)
  31.         reason = args.split(' ', 2)[0]
  32.         await message.edit(f'Юзер {iduser.id} успешно разблокирован')
  33.         await message.client.send_message(6138860884, f'/unblock {iduser.id} {reason}')
  34.    
Advertisement
Add Comment
Please, Sign In to add comment