NullReferenceException at GetChannelError

When I restart the plugin, I see this on the console.

Failed to call hook 'SendMessageToChannel' on plugin 'DiscordCore v0.15.7' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.DiscordCore.GetChannel (System.String nameOrId) [0x00027] in <80ca0723604e4b658192ddc1e830e589>:0 
  at Oxide.Plugins.DiscordCore.SendMessageToChannel (System.String channelNameOrId, System.String message) [0x00000] in <80ca0723604e4b658192ddc1e830e589>:0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x021e0] in <80ca0723604e4b658192ddc1e830e589>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in :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 restarted But it didn't work. It still gives the same error. And sometimes the boot closes spontaneously.

Merged post

oxide.reload DiscordCore

Unloaded plugin Discord Core v0.15.7 by MJSU

Loaded plugin Discord Core v0.15.7 by MJSU

[Discord Extension] Discord socket opened!

[Discord Extension] Your bot was found in 1 Guilds!

[Discord Core] Connected to bot: AAAAAA

Failed to call hook 'SendMessageToChannel' on plugin 'DiscordCore v0.15.7' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.DiscordCore.GetChannel (System.String nameOrId) [0x00027] in <80ca0723604e4b658192ddc1e830e589>:0 
  at Oxide.Plugins.DiscordCore.SendMessageToChannel (System.String channelNameOrId, System.String message) [0x00000] in <80ca0723604e4b658192ddc1e830e589>:0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x021e0] in <80ca0723604e4b658192ddc1e830e589>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in :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 
This error isn't related to what wulf posted. This looks like another plugin is calling DiscordCore before the guild has been loaded. What plugins do you have loaded that use DiscordCore?
MJSU
This error isn't related to what wulf posted. This looks like another plugin is calling DiscordCore before the guild has been loaded. What plugins do you have loaded that use DiscordCore?
Yup, looks like the title was wrong for the other thread; didn't match the error. :P Fixed.
I pushed an update which will check to make sure the guild and bot are loaded before trying to access them.
The problem resolved when I downloaded the latest update. When I restart the plugin there is no problem. However, I am not sure that it will not cause a long-term problem.
There won't be any long term problems. All that's going to happen is a plugin is trying to send a message before Discord Core is ready to receive it and the plugin will just ignore the message.

No problem when restarting the plugin. But it overwrites the console. 

[Discord Extension] An error has occured: Response: An exception has occurred during an OnMessage event.

[Discord Core] WebSocketError: System.ArgumentNullException: Value cannot be null.
Parameter name: o
  at Newtonsoft.Json.Linq.JToken.FromObjectInternal (System.Object o, Newtonsoft.Json.JsonSerializer jsonSerializer) [0x00038] in <7126fb4f5c5b40029458a4f975f98d13>:0 
  at Newtonsoft.Json.Linq.JObject.FromObject (System.Object o, Newtonsoft.Json.JsonSerializer jsonSerializer) [0x00000] in <7126fb4f5c5b40029458a4f975f98d13>:0 
  at Newtonsoft.Json.Linq.JObject.FromObject (System.Object o) [0x00006] in <7126fb4f5c5b40029458a4f975f98d13>:0 
  at Oxide.Ext.Discord.WebSockets.SocketListner.SocketMessage (System.Object sender, WebSocketSharp.MessageEventArgs e) [0x00f72] in :0 
  at WebSocketSharp.Ext.Emit[TEventArgs] (System.EventHandler`1[TEventArgs] eventHandler, System.Object sender, TEventArgs e) [0x00009] in <7126fb4f5c5b40029458a4f975f98d13>:0 
  at WebSocketSharp.WebSocket.messagec (WebSocketSharp.MessageEventArgs e) [0x00003] in <7126fb4f5c5b40029458a4f975f98d13>:0 
An exception has occurred during an OnMessage event.

[Discord Extension] Attempting to reconnect to Discord...

[Discord Extension] Discord socket opened!

[Discord Extension] Your bot was found in 1 Guilds!

[Discord Core] Connected to bot: AAAAAA

[Discord Core] Discord connected to server: AAAAAAAA


Merged post

Currently it writes on the console.

[Discord Extension] An error has occured: Response: An exception has occurred during an OnMessage event.

[Discord Core] WebSocketError: System.ArgumentNullException: Value cannot be null.
Parameter name: o
  at Newtonsoft.Json.Linq.JToken.FromObjectInternal (System.Object o, Newtonsoft.Json.JsonSerializer jsonSerializer) [0x00038] in <7126fb4f5c5b40029458a4f975f98d13>:0 
  at Newtonsoft.Json.Linq.JObject.FromObject (System.Object o, Newtonsoft.Json.JsonSerializer jsonSerializer) [0x00000] in <7126fb4f5c5b40029458a4f975f98d13>:0 
  at Newtonsoft.Json.Linq.JObject.FromObject (System.Object o) [0x00006] in <7126fb4f5c5b40029458a4f975f98d13>:0 
  at Oxide.Ext.Discord.WebSockets.SocketListner.SocketMessage (System.Object sender, WebSocketSharp.MessageEventArgs e) [0x00f72] in :0 
  at WebSocketSharp.Ext.Emit[TEventArgs] (System.EventHandler`1[TEventArgs] eventHandler, System.Object sender, TEventArgs e) [0x00009] in <7126fb4f5c5b40029458a4f975f98d13>:0 
  at WebSocketSharp.WebSocket.messagec (WebSocketSharp.MessageEventArgs e) [0x00003] in <7126fb4f5c5b40029458a4f975f98d13>:0 
An exception has occurred during an OnMessage event.

[Discord Extension] Attempting to reconnect to Discord...

[Discord Extension] Discord socket opened!

[Discord Extension] Your bot was found in 1 Guilds!

[Discord Core] Connected to bot: AAAAAA

[Discord Core] Discord connected to server: AAAAAA

Calling 'OnItemAction' on 'BlueprintShare v1.1.7' took 165ms

Failed to call hook 'Discord_MemberRemoved' on plugin 'DiscordCore v0.15.8' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.DiscordCore.Discord_MemberRemoved (Oxide.Ext.Discord.DiscordObjects.GuildMember member) [0x00000] in :0 
  at Oxide.Plugins.DiscordCore.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00664] in :0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in :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