PsychoTea / Oxide.Ext.Discord

Discord extension and integration
https://umod.org/extensions/discord
12 stars 25 forks source link

User DM #36

Closed MadLad1Clip closed 6 years ago

MadLad1Clip commented 6 years ago

Not sure if this is already part of the system but does it support user Direct Messaging?

MadLad1Clip commented 6 years ago

OK found the functions but seems I might be having some problems here. I have built in this function but getting an error.

User.GetUser(Client, "USERIDHERE", user => { user.CreateDM(Client, chan => { Channel.GetChannel(Client, chan.ToString(), chan1 => { chan1.CreateMessage(Client, "TEST MESSAGE"); }); }); });

(NullReferenceException: Object reference not set to an instance of an object) at Oxide.Ext.Discord.DiscordObjects.User.GetUser (Oxide.Ext.Discord.DiscordClient client, System.String userID, System.Action`1[T] callback) [0x0000e] in :0

Anyone able to help me out with what I might be doing wrong. Sorry I am quite new to coding C#

recon88 commented 5 years ago

May I ask if you figured out how it works? Would appreciate an example :)