Open za419 opened 3 years ago
@za419
~Suggestion: I see use in a Cadence config reset
command-- something to restore a config file back to a default state (so the bot doesn't have to be restarted to clear any Intelligent configurations). Is this possible?~
Oh, it's already proposed in #43. Disregard last.
Yes, the scope for this is such that config changes are potentially very short-lived - Since this is only runnable by the instance admin, and these changes don't save to disk, reset
isn't really necessary - If I screw up badly enough that I need to restore, it's probably acceptable to just restart the bot.
This is essentially the base, not all that useful, skeleton upon which this whole idea of "Let CadenceBot be personalized to servers!" gets built on.
Allow the server admin to perform changes to the loaded configuration from Discord. This configuration is volatile - It is not saved to disk, and so it will be lost when CadenceBot restarts.
Syntax: One prefix (
Cadence config
) puts us into a configuration flow (thus only needing to check once for admin rights), then the remainder of the command describes what shall be done:set <quotable config key> <quotable value>
Cadence config set unsetkey.child.grandchild true
to create empty keys along the way)get <quotable config key>
Cadence config get unsetkey.child.grandchild
to print "undefined"delete <quotable config key>
Cadence config delete administrator
, you should not be surprised that you can't use admin-only commands, and if youCadence config delete customCommands
, you should be smart enough to know that's going to crash the bot next time it sees a non-command message from an unbanned user - For the purposes of this issue, these are the barrier to entry as a CadenceBot instance admin.append <quotable config key> <quotable value>
list
Cadence config
- Dumps out the currently loaded config into the text channelExamples:
Cadence config set "customCommands.equalTo.Cadence say hello.response" "Hello World!"
Previously undefined
Cadence say hello
and receive the responseHello World!
Cadence config get logging.level
Cadence config delete "customCommands.targeted.Cadence echo to"
Deleted, was previously <insert JSON blob here>
Cadence echo to
will not trigger any response.Cadence config append "customCommands.Cadence flip a coin.random" Edge...?
Added one value, array now contains 3 values.
Cadence flip a coin
will produce the responseEdge...?
with probability ideally one third (RNG-dependent)Cadence config list
Cadence config
as of this issue's opening.