Advertisement
Guest User

Untitled

a guest
Mar 13th, 2023
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | Source Code | 0 0
  1. class CMDEvents(commands.Cog):
  2.     def __init__(self, bot):
  3.         self.Bot = bot
  4.        
  5.     @commands.Cog.listener()
  6.     async def on_ready(self):
  7.         print("[Debug] Начинаю загрузку данных...")
  8.  
  9.         for command in collcustomcommands.find():
  10.             async def custom_command(ctx):
  11.                 if command['text'] == 'null':
  12.                     await ctx.reply("`[Error] Данная команда не настроена, используйте /commandsettings`")
  13.                 else:
  14.                     if command['command_type'] == 1:
  15.                         await ctx.send(command['text'])
  16.                     else:
  17.                         pass
  18.             self.Bot.add_command(commands.Command(name=command['name'], callback = custom_command))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement