How to make my discord.py rewrite bot send a Private Message to the message author

前端 未结 2 1840
忘了有多久
忘了有多久 2021-01-25 11:28

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\'v

2条回答
  •  隐瞒了意图╮
    2021-01-25 12:15

    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

提交回复
热议问题