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

前端 未结 2 1959
忘了有多久
忘了有多久 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:17

    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!")
    

提交回复
热议问题