I have a discord bot written in python and I'm trying to create command to make say command with blacklisted messages (the annoying things). It supposed to give the error message and for some reason the if and else statements both are executing. Why it it happening? What am i doing wrong?
I have tried adding break pass and it still did the else statement
Here's my current code for the command:
@client.command()
async def say(ctx, *, message):
if message == '@everyone':
await ctx.message.delete()
await ctx.send('Do not abuse this command')
if message == '@here':
await ctx.message.delete()
await ctx.send('Do not abuse this command')
for role in ctx.guild.roles:
if message == f'<@&{role.id}>':
await ctx.message.delete()
await ctx.send('Nice try but do not abuse this command')
else:
await ctx.send(message)
await ctx.message.delete()
print(f'{ctx.message.author} ({ctx.author.id}) in {ctx.guild.name} ({ctx.guild.id}) made me say: {message}')
Aucun commentaire:
Enregistrer un commentaire