Answer the question
In order to leave comments, you need to log in
Discord.py private messages by id?
There is a discord server and it has a bot written in python.
It is necessary that the bot send a private message to the admin when entering the command.
async def test(ctx):
await ctx.author.send('test')
async def test(ctx):
await ctx.idadmin.send('test')
Answer the question
In order to leave comments, you need to log in
The code is not written correctly, read the discord.py documentation
Link: https://discordpy.readthedocs.io/en/latest/api.html
code that can function:
async def test(ctx, *, user_id: int):
user = await Client.fetch_user(user_id=user_id)
await user.send('test')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question