'Suggest command discord.py
I am making a discord bot in discord.py, and I want my members to be able to suggest features to me, and of course they can't just say it in the server, I probably wouldn't even know. So I want the bot to DM message it to me, lets say my discord is DiscordUser#1234 and another user used the suggest command, the other user is AnotherUser#4321. When AnotherUser used the suggest command, it would work in this format: (prefix) suggest (Suggestion). So DiscordUser would recieve AnotherUser#4321 has suggested (Suggestion)
I got the command working and everything is fine, except i don't know how to DM a specific person
Solution 1:[1]
This is the easiest way I've been able to do this, hope it helps!
@client.command()
async def suggest(ctx, *, text):
user = await client.fetch_user("<your_id_here>")
await user.send(f"""{ctx.author.mention} has suggested {text}""")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
