NullReferenceException at GetUserByUsernameError
Running this in Rust server, I am getting this error. I am getting this error when I do /dc join umodder#1234 Also no way to get it to work, please fix?
Failed to call hook 'DiscordChatCommand' on plugin 'DiscordCore v0.12.8' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.DiscordCore.GetUserByUsername (System.String userName) [0x0000d] in :0 
  at Oxide.Plugins.DiscordCore.HandleJoin (Oxide.Core.Libraries.Covalence.IPlayer player, System.String[] args) [0x0007a] in :0 
  at Oxide.Plugins.DiscordCore.DiscordChatCommand (Oxide.Core.Libraries.Covalence.IPlayer player, System.String cmd, System.String[] args) [0x00089] in :0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0052c] in :0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0 
Failed to call hook 'DiscordChatCommand' on plugin 'DiscordCore v0.12.8' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.DiscordCore.GetUserByUsername (System.String userName) [0x0000d] in :0 
  at Oxide.Plugins.DiscordCore.HandleJoin (Oxide.Core.Libraries.Covalence.IPlayer player, System.String[] args) [0x0007a] in :0 
  at Oxide.Plugins.DiscordCore.DiscordChatCommand (Oxide.Core.Libraries.Covalence.IPlayer player, System.String cmd, System.String[] args) [0x00089] in :0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0052c] in :0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0 
Failed to call hook 'DiscordChatCommand' on plugin 'DiscordCore v0.12.8' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.DiscordCore.GetUserByUsername (System.String userName) [0x0000d] in :0 
  at Oxide.Plugins.DiscordCore.HandleJoin (Oxide.Core.Libraries.Covalence.IPlayer player, System.String[] args) [0x0007a] in :0 
  at Oxide.Plugins.DiscordCore.DiscordChatCommand (Oxide.Core.Libraries.Covalence.IPlayer player, System.String cmd, System.String[] args) [0x00089] in :0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0052c] in :0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0 
Failed to call hook 'DiscordChatCommand' on plugin 'DiscordCore v0.12.8' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.DiscordCore.GetUserByUsername (System.String userName) [0x0000d] in :0 
  at Oxide.Plugins.DiscordCore.HandleJoin (Oxide.Core.Libraries.Covalence.IPlayer player, System.String[] args) [0x0007a] in :0 
  at Oxide.Plugins.DiscordCore.DiscordChatCommand (Oxide.Core.Libraries.Covalence.IPlayer player, System.String cmd, System.String[] args) [0x00089] in :0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0052c] in :0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0 
Failed to call hook 'DiscordChatCommand' on plugin 'DiscordCore v0.12.8' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.DiscordCore.GetUserByUsername (System.String userName) [0x0000d] in :0 
  at Oxide.Plugins.DiscordCore.HandleJoin (Oxide.Core.Libraries.Covalence.IPlayer player, System.String[] args) [0x0007a] in :0 
  at Oxide.Plugins.DiscordCore.DiscordChatCommand (Oxide.Core.Libraries.Covalence.IPlayer player, System.String cmd, System.String[] args) [0x00089] in :0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0052c] in :0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0 
If you're getting this error I believe the plugin isn't properly connected to discord. I added some error checking in join to make sure it's connected. Can you please try version 0.12.9 and let me know?
In response to MJSU ():
If you're getting this error I believe the plugin isn't properly connected to discord. I added some...

I am running now the new version 0.12.9, the bot started to work so that's a step forward! However there are more errors in the server console, example:

 

[Better Chat] umodder: Test
Failed to call hook 'OnUserChat' on plugin 'DiscordChat v0.12.7' (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.DiscordChat.GetPlayerName (Oxide.Core.Libraries.Covalence.IPlayer player) [0x00000] in <8f7bfcae1494458fbc133df95284fcc6>:0
at Oxide.Plugins.DiscordChat.SendPlayerMessageToChannel (Oxide.Core.Libraries.Covalence.IPlayer player, System.String message) [0x0003d] in <8f7bfcae1494458fbc133df95284fcc6>:0
at Oxide.Plugins.DiscordChat.OnUserChat (Oxide.Core.Libraries.Covalence.IPlayer player, System.String message) [0x00061] in <8f7bfcae1494458fbc133df95284fcc6>:0
at Oxide.Plugins.DiscordChat.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0014d] in <8f7bfcae1494458fbc133df95284fcc6>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0

Failed to call hook 'OnUserChat' on plugin 'DiscordChat v0.12.7' (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.DiscordChat.GetPlayerName (Oxide.Core.Libraries.Covalence.IPlayer player) [0x00000] in <8f7bfcae1494458fbc133df95284fcc6>:0
at Oxide.Plugins.DiscordChat.SendPlayerMessageToChannel (Oxide.Core.Libraries.Covalence.IPlayer player, System.String message) [0x0003d] in <8f7bfcae1494458fbc133df95284fcc6>:0
at Oxide.Plugins.DiscordChat.OnUserChat (Oxide.Core.Libraries.Covalence.IPlayer player, System.String message) [0x00061] in <8f7bfcae1494458fbc133df95284fcc6>:0
at Oxide.Plugins.DiscordChat.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0014d] in <8f7bfcae1494458fbc133df95284fcc6>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0

[Discord Extension] An error occured whilst submitting a request to https://discordapp.com/api/channels/605483263275958283/messages (code BadRequest): {"code": 50006, "message": "Cannot send an empty message"}

Discord Extension] An error occured whilst submitting a request to https://discordapp.com/api/channels/605483263275958283/messages (code BadRequest): {"code": 50006, "message": "Cannot send an empty message"}​


Merged post

I want to also add, the Bot is deleting all of our Discord messages in the specified channel. Is this normal?

We need the 2 way chat (Discord <--> Server)

Please download the latest update of DiscordChat. There was an issue if you didn't have a clans plugin it would throw that error.

About the deletion this is normal. What it does is it reads the message from the user. Deletes the message and replaces it with the same message from the bot. It keeps the channel looking cleaner.