I have made a Discord bot for a game's Discord server. I'm using the discord.py rewrite version and I want to send a private message to the author of the message.
I've tried other codes on the internet which includes some "@bot" code, but it always comes up with the error
"Name 'bot' is not defined"
and if I try send_message it says
"Client object has no attribute 'send_message'"
My code:
#I've tried this...
@bot.command(pass_context=True)
async def poke(ctx, message):
await client.send_message(ctx.message.author, 'boop')
#but it comes up with the error "Name 'bot' is not defined" and stuff like that
For example, I want to create a command "!messageme", and if a user executes the command I expect the bot to private message the author of the message saying "Just messaged you!".
If Pierce#9255 executes the command in the server, the bot should private message him saying "Just messaged you!".