PsychoTea / Oxide.Ext.Discord

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

Add OnPluginUnload handling, and new optional settings class. #18

Closed dylanzemlin closed 6 years ago

dylanzemlin commented 6 years ago

This adds a OptionalSettings class, along with plugin unload handling. This allows it so that when a plugin unloads, the discord bot will discord as well. Unless there is more than one plugin supporting the bot. This can probably be cleaned up and put into the DiscordSettings class, but this is for an example of what is possible.

PsychoTea commented 6 years ago

We need the bot to stay connected, otherwise when a plugin is reloaded it will disconnect and re-connect with rapid succession. It's much more efficient to leave the bot connected for the lifespan of the server.

DDraBB commented 6 years ago

I would add something to restart the connection if it's spamming a web request exception. This will freeze up the server.

PsychoTea commented 6 years ago

...that's not how we handle bugs 😛

DDraBB commented 6 years ago

Sure sir, just wanted to inform you this way so we don't forget about it