Rapptz / discord.py

An API wrapper for Discord written in Python.
http://discordpy.rtfd.org/en/latest
MIT License
14.77k stars 3.75k forks source link

How to make the bot respond to a DM? #1833

Closed nhdxyz closed 5 years ago

nhdxyz commented 5 years ago

Hello, how would I make my bot respond to a dm? I have a command that DM's the user who sent the message but I would like to also make it so then the user can respond to the bot and the bot will respond back

lgaan commented 5 years ago

Please could you state whether you are async or rewrite. Or for the best chance of help, please go to the official discord.py server

fleesu commented 5 years ago

official discord.py server edit: oops sry

nhdxyz commented 5 years ago

Alright thanks I joined the server

Harmon758 commented 5 years ago

For the async branch, see: https://discordpy.readthedocs.io/en/latest/api.html#discord.Message.channel https://discordpy.readthedocs.io/en/latest/api.html#privatechannel https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.send_message

For the rewrite branch, see: https://discordpy.readthedocs.io/en/rewrite/api.html#discord.Message.channel https://discordpy.readthedocs.io/en/rewrite/api.html#discord.DMChannel.send

Since your issue seems to have been resolved, feel free to close it now, and as indicated and as the README recommends, for future questions like this, you should join either the official discord.py server or the Discord API server for help.

itssigron commented 5 years ago

await ctx.author.send("message here")