Search code examples
pythonpython-3.xdiscorddiscord.py

Custom bot command not working for discord bot made by discord.py


So basically I've created a discord bot. It has the function to add role to users if the user writes a particular type of message on a particular channel. I've removed the default help command by this code bot = commands.Bot(command_prefix='!', help_command=None) but When the add role process is working the bot is ignoring the commands specially the help command the code is here:

@bot.command()
async def help(ctx):
    embeding = discord.Embed(description='Some Message')
    await ctx.send(embed=embeding)

How can I fix this issue?

I'm using on_message function for assigning roles


Solution

  • You haven't shown us your role command so there is only so much I can recommend.

    First of all, you may be better of using the following code after you define your bot:

    bot.remove_command('help')

    Using an on_message function will often also disable your other commands, so be sure to add this line of code to the bottom of your on_message function:

    await bot.process_commands(message)