NullReferenceException at UpdateStatusError
On server startup I get this error and see it pop up from time to time as the game runs.
(05:53:57) | [Discord Extension] Discord socket opened!
(05:53:57) | [Discord Extension] Your bot was found in 1 Guilds!
(05:53:57) | [Discord Core] Connected to bot: Rust Fails 5x-Bot
(05:53:57) | [Discord Core] Discord connected to server: Rust Fails
(05:53:57) | [Discord Extension] An error has occured: Response: An exception has occurred during an OnMessage event.
(05:53:57) | [Discord Core] WebSocketError: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException (System.ExceptionResource resource) [0x0000b] in <a8ed250850854b439cedc18931a314fe>:0
at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00013] in <a8ed250850854b439cedc18931a314fe>:0
at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x0004a] in <a8ed250850854b439cedc18931a314fe>:0
at System.Linq.Enumerable+WhereListIterator`1[TSource].MoveNext () [0x0004e] in <b7efe7e6e548497fac3c4a6049a0a4b6>:0
at Oxide.Ext.Discord.DiscordClient.CallHook (System.String hookname, Oxide.Core.Plugins.Plugin specificPlugin, System.Object[] args) [0x0008c] in <a141f1996e934ec597a4fcdd8f3a7ede>:0
at Oxide.Ext.Discord.WebSockets.SocketListner.SocketMessage (System.Object sender, WebSocketSharp.MessageEventArgs e) [0x00c14] in <a141f1996e934ec597a4fcdd8f3a7ede>:0
at WebSocketSharp.Ext.Emit[TEventArgs] (System.EventHandler`1[TEventArgs] eventHandler, System.Object sender, TEventArgs e) [0x00009] in <8fe7f8665ff548909c2f26d557e5093a>:0
at WebSocketSharp.WebSocket.messagec (WebSocketSharp.MessageEventArgs e) [0x00003] in <8fe7f8665ff548909c2f26d557e5093a>:0
An exception has occurred during an OnMessage event.
(05:53:57) | [Discord Extension] Attempting to reconnect to Discord...
(05:53:57) | [Discord Extension] Discord connection closed uncleanly: code 1000, Reason:
(05:53:57) | [Discord Extension] Attempting to reconnect to Discord...
(05:53:57) | [Discord Extension] Error: WSSURL not present! Retrying..
(05:53:57) | [Discord Extension] Discord socket opened!
(05:53:57) | [Discord Extension] Attempting resume opcode...
(05:53:57) | [Discord Extension] An error has occured: Response: An exception has occurred during an OnMessage event.
(05:53:57) | [Discord Extension] Attempting to reconnect to Discord...
(05:53:57) | [Discord Extension] Discord connection closed uncleanly: code 1006, Reason:
(05:53:57) | [Discord Extension] Attempting to reconnect to Discord...
(05:53:57) | Failed to call hook 'UpdatePresence' on plugin 'DiscordCore v0.14.6' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Ext.Discord.DiscordClient.UpdateStatus (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0001c] in <a141f1996e934ec597a4fcdd8f3a7ede>:0
at Oxide.Plugins.DiscordCore.UpdatePresence (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0000d] in <00e004eed926401ab24fb698edc9016e>:0
at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00707] in <00e004eed926401ab24fb698edc9016e>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <33f7c42a56934dae8ec04b11017dce31>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <b0a93b504f034a0db8b1c3d2503c0987>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <b0a93b504f034a0db8b1c3d2503c0987>:0
(05:53:58) | [Discord Extension] Discord socket opened!
(05:53:58) | [Discord Extension] Attempting resume opcode...
(05:53:58) | [Discord Extension] An error has occured: Response: An exception has occurred during an OnMessage event.
(05:53:58) | [Discord Extension] Discord socket opened!
(05:53:58) | [Discord Extension] Warning: tried to create a heartbeat when one is already registered.
(05:53:58) | [Discord Extension] Attempting resume opcode...
(05:53:58) | [Discord Extension] An error has occured: Response: An exception has occurred during an OnMessage event.​
Everything else checks out, but I just started getting the WebSocketError with mine after the server restart as of one day ago.

i get the Error inn my Console

Failed to call hook 'UpdatePresence' on plugin 'DiscordCore v0.15.0' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Ext.Discord.DiscordClient.UpdateStatus (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0001c] in <618cbb3cd1f24a338ef71fa504209e7a>:0
  at Oxide.Plugins.DiscordCore.UpdatePresence (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0000d] in :0
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x003b4] in :0
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <008b12f41ec4452da1a5497eeb849299>:0
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in :0
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in :0
I'm also getting the same error as above

Merged post

I get a few minutes of errors, and during that time none of the discord functionality is live. It eventually comes back, but this doesn't seem right.

(23:48:27) | Failed to call hook 'UpdatePresence' on plugin 'DiscordCore v0.15.0' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Ext.Discord.DiscordClient.UpdateStatus (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0001c] in <618cbb3cd1f24a338ef71fa504209e7a>:0 
  at Oxide.Plugins.DiscordCore.UpdatePresence (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0000d] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x003b4] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <008b12f41ec4452da1a5497eeb849299>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <ac41dd3599754d448b8c218b34645820>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <ac41dd3599754d448b8c218b34645820>:0
(23:48:42) | Failed to call hook 'UpdatePresence' on plugin 'DiscordCore v0.15.0' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Ext.Discord.DiscordClient.UpdateStatus (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0001c] in <618cbb3cd1f24a338ef71fa504209e7a>:0 
  at Oxide.Plugins.DiscordCore.UpdatePresence (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0000d] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x003b4] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <008b12f41ec4452da1a5497eeb849299>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <ac41dd3599754d448b8c218b34645820>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <ac41dd3599754d448b8c218b34645820>:0
(23:48:57) | Failed to call hook 'UpdatePresence' on plugin 'DiscordCore v0.15.0' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Ext.Discord.DiscordClient.UpdateStatus (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0001c] in <618cbb3cd1f24a338ef71fa504209e7a>:0 
  at Oxide.Plugins.DiscordCore.UpdatePresence (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0000d] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x003b4] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <008b12f41ec4452da1a5497eeb849299>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <ac41dd3599754d448b8c218b34645820>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <ac41dd3599754d448b8c218b34645820>:0
(23:49:12) | Failed to call hook 'UpdatePresence' on plugin 'DiscordCore v0.15.0' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Ext.Discord.DiscordClient.UpdateStatus (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0001c] in <618cbb3cd1f24a338ef71fa504209e7a>:0 
  at Oxide.Plugins.DiscordCore.UpdatePresence (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0000d] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x003b4] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <008b12f41ec4452da1a5497eeb849299>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <ac41dd3599754d448b8c218b34645820>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <ac41dd3599754d448b8c218b34645820>:0
(23:49:27) | Failed to call hook 'UpdatePresence' on plugin 'DiscordCore v0.15.0' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Ext.Discord.DiscordClient.UpdateStatus (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0001c] in <618cbb3cd1f24a338ef71fa504209e7a>:0 
  at Oxide.Plugins.DiscordCore.UpdatePresence (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0000d] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x003b4] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <008b12f41ec4452da1a5497eeb849299>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <ac41dd3599754d448b8c218b34645820>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <ac41dd3599754d448b8c218b34645820>:0
(23:49:42) | Failed to call hook 'UpdatePresence' on plugin 'DiscordCore v0.15.0' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Ext.Discord.DiscordClient.UpdateStatus (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0001c] in <618cbb3cd1f24a338ef71fa504209e7a>:0 
  at Oxide.Plugins.DiscordCore.UpdatePresence (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0000d] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x003b4] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <008b12f41ec4452da1a5497eeb849299>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <ac41dd3599754d448b8c218b34645820>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <ac41dd3599754d448b8c218b34645820>:0
(23:49:57) | Failed to call hook 'UpdatePresence' on plugin 'DiscordCore v0.15.0' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Ext.Discord.DiscordClient.UpdateStatus (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0001c] in <618cbb3cd1f24a338ef71fa504209e7a>:0 
  at Oxide.Plugins.DiscordCore.UpdatePresence (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0000d] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x003b4] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <008b12f41ec4452da1a5497eeb849299>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <ac41dd3599754d448b8c218b34645820>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <ac41dd3599754d448b8c218b34645820>:0
(23:50:12) | Failed to call hook 'UpdatePresence' on plugin 'DiscordCore v0.15.0' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Ext.Discord.DiscordClient.UpdateStatus (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0001c] in <618cbb3cd1f24a338ef71fa504209e7a>:0 
  at Oxide.Plugins.DiscordCore.UpdatePresence (Oxide.Ext.Discord.DiscordObjects.Presence presence) [0x0000d] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x003b4] in <298a384e3c7e40a5b15a134c1ab9fcde>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <008b12f41ec4452da1a5497eeb849299>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <ac41dd3599754d448b8c218b34645820>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <ac41dd3599754d448b8c218b34645820>:0
(23:50:17) | [Discord Core] Heartbeat timed out. Reconnecting
(23:50:19) | [Discord Extension] Discord socket opened!
(23:50:19) | [Discord Extension] Your bot was found in 1 Guilds!
(23:50:19) | [Discord Core] Connected to bot: 5x RUST Server
(23:50:21) | [Discord Core] Discord connected to server: [servername withheld]
I've been getting this error on my server for the past month as well. As this error seems to preceed our server crashes.
I get this error ever since the last update.
That error is coming from the discord extension. I've gone ahead and hid the message so it doesn't spam anymore in version 0.15.1.
MJSU
That error is coming from the discord extension. I've gone ahead and hid the message so it doesn't spam anymore in version 0.15.1.

Thank you

MJSU
That error is coming from the discord extension. I've gone ahead and hid the message so it doesn't spam anymore in version 0.15.1.

I noticed while the error happens, the bot seems to lose all functionality. Is there a fix on the way for this?