• Ask a Question
  • Create a Poll
150
    Ask a Question
    Cancel
    150
    More answer You can create 5 answer(s).
      Ask a Poll
      Cancel

      Discord.py tried to make blacklist system

      I tried to make blacklist system in discord.py

      class blackk(commands.CheckFailure): pass  def __global_check_once(ctx):     cursor.execute(f"SELECT ban_id FROM bany WHERE ban_id = {ctx.author.id}")     r = cursor.fetchone()     if r is not None:         raise blackk()     else:         return    @bot.event async def on_command_error(ctx, error):     if isinstance(error, blackk):         await ctx.send("blacklisted") 

      I really need it. Someone know better way to do it (example please)

      Asked by Billyreggiedeidre on July 16, 2020 in Python.
      1 Answers

      I believe __global_check_once has been replaced by bot_check_once. It should return True or False. You can find a list of Cog special methods here

      Answered by Clauderobbiemarjorie on July 16, 2020..