Answers for "how to know if anyone mentions the bot in discord.py"

2

how to check if a message includes a word discord.py

@bot.event
async def on_message(msg):
    if 'word' in msg.content:
        print('Keyword found')
        # Do stuff here
Posted by: Guest on January-25-2021
-1

discord.py check if user is bot

@bot.command()
async def kick(ctx, user: discord.Member, *, reason="No reason provided"):
    if not user.bot:
        await user.kick(reason=reason)
        await ctx.send(f"Successfully kicked {user}!")
    else:
        await ctx.send("You can't kick a bot!")
Posted by: Guest on March-31-2021

Code answers related to "how to know if anyone mentions the bot in discord.py"

Python Answers by Framework

Browse Popular Code Answers by Language