ddiomedi2906 / CC3201Bot

Discord Bot for supporting group work in courses.
1 stars 3 forks source link

Clarify or remove test guild #12

Closed aidhog closed 3 years ago

aidhog commented 3 years ago

I am still not super clear on whether or not the test guild is strictly necessary, or what it is needed for.

What I have noticed is that the bot uses it to save some guild settings, and that without calling !save-guild before stopping the bot and restarting it, all groups would sometimes be opened upon restarting the bot. In general it would be good to clarify in the documentation how it is used (or even better to remove it if not necessary).

ddiomedi2906 commented 3 years ago

I agree with removing it. The only use of it is to display the snapshot update messages that are not really necessary (but maybe we need another way to let the guild admins that automatic save is a feature).

About the use of !save-guild: The bot is running the configuration found in the config.json file that is loaded in memory (which is the one that is updated when closing groups) and if it restarts without saving, then it resumes from an "outdated" version of the config file. Later, the gist of the !save-guild command is to save such configuration in this config file to read from that same file when the bot is turned on again. There are elements of the guild that are not stored in the guild itself. Things like guild members, what roles they have, permissions is information that the guild has saved (and is accessed via the discord API). On the other hand, things like the open/closed state, help queue, or flags (such as the limit of the size of the groups) are some things we invented, therefore we are in charge of saving that information (hence the need to have a config file).

I created #13 to address this issue.

aidhog commented 3 years ago

Understood! Perhaps there might be ways to "encode" more of this state into the guild, using particular naming schemes for groups, categories, etc.

This could work okay for open/closed groups (just suffix the category name with -o or -c, for example), but I guess it might get messy for more complex state.

Ideally I guess the guild could store all of its own state as it already stores most of it (who has what role, what group, what channels, etc.). I guess it's a question of what state the guild is missing.