#DM user with known ID
1 messages · Page 1 of 1 (latest)
Hey! Once your issue is solved, press the button below to close this thread!
await bot.fetch_user().send()
Where do I specify the content of the message and the users id?
it's the same as ctx.send(). fetch_user(<id here>) gets a user object from the id
I get this error
File "/root/botv2.py", line 46, in poke_function
await ctx.send("test").fetch_user(187867424207405056)
AttributeError: 'coroutine' object has no attribute 'fetch_user'
you misunderstood what i said.
await bot.fetch_user(id) returns a User object which has the asyncronous send() method. The arguments are the same as ctx.send().
also you can't really chain asyncronous functions
so altogether it would be
user = await bot.fetch_user(1234)
await user.send(content="Hello World")
perfect, thanks a lot