JackDotJS / OptiBot

(DISCONTINUED) The original Discord bot for OptiFine. https://discord.gg/3mMpcwW
1 stars 0 forks source link

!cfg - download, edit, and upload configuration files #271

Open JackDotJS opened 3 years ago

JackDotJS commented 3 years ago
!cfg [file attachment]

allows you to upload or download the bot's config file. uploaded files will be loaded immediately, but will force the bot to perform a full restart.

ZenithRogue commented 3 years ago

This command is potentially dangerous without proper protocols in place.

  1. The command needs to validate the uploaded json before load.
  2. The bot should create a back up of the previous config before overwriting.
  3. If the changes cause the bot to crash on load, it should restore the functional config
JackDotJS commented 3 years ago

validating json is easy, i even had a command specifically for doing that in an older version of the bot.

backing up the cfg sounds like a good idea, though the bot probably wouldnt be able to tell if its specifically the new config that causes a crash.

ZenithRogue commented 3 years ago

What i meant is if it crashes almost immediately on boot.

I don't know of any other good way to do that

JackDotJS commented 3 years ago

well yeah obv, its just that theres no easy way for the bot to be 100% sure what causes the crash. checking if the process crashes after loading a new cfg is easy but im just saying its entirely possible for the crash to be caused by something else