#DM a DiscordUser

1 messages · Page 1 of 1 (latest)

tall pebble
#

i'm in the process of migrating from d.net to this, but i seem to be unable to create a DM channel from a DiscordUser, which is what i get from DiscordClient#GetUserAsync.

there is no way for me to fetch this member from a guild without iterating through every single guild, and in order to even get to this state - we will have been able to DM the user at least once.

robust sleet
#

if you know you'll have a shared server, the DSharpPlus.Rest package got you covered

#

it contains the direct API call which just takes an user ID

tall pebble
#

i did have a look at that, although it seems to want initialising in the exact same way the shardedclient does, with its own config and such

weary lotus
#

The original justification for disallowing this was solely because Emzi said "you might not share a guild with the user", but times have changed shrug free PR for anyone who looks at this thread, really

robust sleet
#

emzis justification isn't bad per say, at least as long as our cache remains questionable

#

but i don't see much of a reason to keep it this way

tall pebble
#

potentially a hacky workaround for now whilst that's being discussed - could i maybe just get the first mutual guild with the user, then get the DiscordMember from there, then DM them that way?