skhere
skhere

Reputation: 1

Problem in my EVAL code, discord.py...(my eval code doesn't work)

@client.command(name='eval')
@commands.is_owner()
async def _eval(ctx, *, cmd):
    result = eval(cmd)
    await ctx.send(f"```{result}```")

This was my code. However, when I type:

!eval message.author.id 

there is no response from the bot, and there is no error also. If you can help me to make a good eval code, your help is appreciated! Thanks. --DarkWatery

Upvotes: 0

Views: 496

Answers (1)

Hassan Serhan
Hassan Serhan

Reputation: 402

Looks like you have an on_message event in your code. Try to do this for it:

   @client.listen('on_message')
    async def on_message_sent(message):
    enter code here

So you need to just change that for your on_message function cause it blocks the commands.

Upvotes: 1

Related Questions