I am working on a bot to do some simple commands for my discord server and I haven\'t been able to figure out how to get the bot to mention people who aren\'t the author.
<
It looks like you're trying to implement commands without actually using commands
. Don't put everything in the on_message
event. If you're not sure how to use the discord.ext.commands
module, you can look at the documentation for the experimental rewrite branch.
import discord
from discord.ext.commands import Bot
bot = Bot(command_prefix='+')
@bot.command()
async def prank(target: discord.Member):
await bot.say(target.mention + ' mention')
bot.run('token')
You would use this command with +prank Johnny
. The bot would then respond in the same channel @Johnny mention