So I've been re-programming my discord bot lately to make it more compliant with the discord Terms of Service. During my reprogramming, I've been attempting to make my bot more resistant to the programming errors I'm bound to include, as I'm merely a novice in C#. My bot was working completely fine yesterday and I've had no major code changes, but as of late I've been getting this error message upon any intensive use.
System.NullReferenceException was unhandled
Message: An unhandled exception of type 'System.NullReferenceException' occurred in mscorlib.dll
Additional information: Object reference not set to an instance of an object.
Now, I don't know much about exceptions and object oriented programming, but I do know this; Why am I getting an error in a library I'm including?
Full code for the bot in a pastebin below.