Add maintenance mode

This commit is contained in:
2022-09-19 09:02:42 +02:00
parent 0afedc86e5
commit fc45908419
2 changed files with 17 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ module.exports = {
{ name: 'bot', value: 'bot' },
{ name: 'reset_cd', value: 'reset_cd' },
{ name: 'add_xp', value: 'add_xp' },
{ name: 'toggle_maintenance', value: 'toggle_maintenance' },
)
)
.addStringOption((option) =>
@@ -111,6 +112,14 @@ module.exports = {
ephemeral: false
});
break;
case "toggle_maintenance":
let maintenance = await GeneralUtils.getBotProperty("maintenance");
await GeneralUtils.setBotProperty("maintenance", !maintenance);
interaction.reply({
content: `Maintenance mode is now ${!maintenance}`,
ephemeral: false
});
break;
default:
interaction.reply({
content: `Your permission level is ${await UserUtils.getPermissionLevel(interaction.member)}`,