Skip to content Skip to sidebar Skip to footer

How To Make My Discord.py Rewrite Bot Send A Private Message To The Message Author

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

Solution 1:

Did you define your bot variable? If not then do this:

bot = commands.Bot(command_prefix='!') # Just add your desired prefix there.

# sending dm
@bot.command()
async def poke(ctx):
    await ctx.author.send('boop!')

Also, if you still confused then just give this yt tutorial a try: -NiByO6h7Ck


Solution 2:

Firstly you have to define the Bot. The you will have to DM a user.

bot = commands.Bot(command_prefix='your_prefix')

@bot.command()
async def hello(ctx):
    user = ctx.author
    await user.send("Hello!")

Post a Comment for "How To Make My Discord.py Rewrite Bot Send A Private Message To The Message Author"