File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/discord.js/src/client/actions Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,17 @@ class GenericAction {
2828 }
2929
3030 getChannel ( data ) {
31- const payloadData = { recipients : data . recipients ?? [ data . author ?? data . user ?? { id : data . user_id } ] } ;
31+ const payloadData = { } ;
3232 const id = data . channel_id ?? data . id ;
33+
34+ if ( 'recipients' in data ) {
35+ payloadData . recipients = data . recipients ;
36+ } else {
37+ // Try to resolve the recipient, but do not add the client user.
38+ const recipient = data . author ?? data . user ?? { id : data . user_id } ;
39+ if ( recipient . id !== this . client . user . id ) payloadData . recipients = [ recipient ] ;
40+ }
41+
3342 if ( id !== undefined ) payloadData . id = id ;
3443 if ( 'guild_id' in data ) payloadData . guild_id = data . guild_id ;
3544 if ( 'last_message_id' in data ) payloadData . last_message_id = data . last_message_id ;
You can’t perform that action at this time.
0 commit comments