Answer the question
In order to leave comments, you need to log in
Is it possible to create an exception for a user in a discord bot?
i want the command to perform a specific action only for a specific user, it doesn't work
@bot.command() #рандомайзер
async def random(ctx):
author = ctx.message.author
if author == 'wsip#2534':
await ctx.send(f'{author.mention}, Ты выбил 6 ')
else:
await ctx.send(f'{author.mention}, Ты выбил {randint(1, 6)}')
Answer the question
In order to leave comments, you need to log in
There is a feeling that there is something in the author that is not as expected. Perhaps there is no line at all.
Is this exactly the author = ctx.message.author
right way to refer to the object you're looking for? .author is by any chance not a method you are calling as a parameter? Check the type of the returned object, is it exactly a string?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question