Now role auto creation on boost can be disabled

Signed-off-by: Louis Hollingworth <louis@hollingworth.ch>
This commit is contained in:
Louis Hollingworth 2023-06-22 20:40:29 +01:00
parent 9f53ee668c
commit a37a8a6935
Signed by: lucxjo
GPG key ID: A11415CB3DC7809B
4 changed files with 89 additions and 48 deletions

View file

@ -133,4 +133,34 @@ export class AdminCmds {
ephemeral: true,
});
}
@Slash({
description: "Enable or disable auto perk roles",
defaultMemberPermissions: PermissionsBitField.Flags.Administrator,
})
async toggle_perk_role_creation(interaction: CommandInteraction) {
if (interaction.guildId) {
const g = await prisma.guild.findUnique({
where: {
id: interaction.guildId,
},
});
await prisma.guild.update({
where: {
id: interaction.guildId,
},
data: {
auto_create_booster_roles: !g?.auto_create_booster_roles,
},
});
interaction.reply({
content: `Booster role creation is now ${
g?.auto_create_booster_roles ? "disabled" : "enabled"
}`,
ephemeral: true,
});
}
}
}