feat(arabot): change role for non vegan access

This commit is contained in:
smyalygames 2023-02-19 13:35:18 +00:00
parent f8a120b135
commit a7c2541d89
3 changed files with 8 additions and 6 deletions

View File

@ -38,7 +38,7 @@ export class NonVeganAccessButtonHandler extends InteractionHandler {
public async run(interaction: ButtonInteraction) {
let { member } = interaction;
const errorMessage = 'There was an error giving you the role, please try again later or contact ModMail/the developer'
const errorMessage = 'There was an error giving you the role, please try again later or contact ModMail/the developer '
+ 'to sort out this problem.';
if (member === null) {
@ -60,19 +60,19 @@ export class NonVeganAccessButtonHandler extends InteractionHandler {
return;
}
if (member.roles.cache.has(IDs.roles.vegan.activist)) {
await member.roles.remove(IDs.roles.vegan.activist);
if (member.roles.cache.has(IDs.roles.vegan.nvAccess)) {
await member.roles.remove(IDs.roles.vegan.nvAccess);
await interaction.reply({
content: 'Your access from the non vegan section has been removed successfully. '
content: 'Your access from the non vegan section has been removed. '
+ 'If you want to gain access again, click this button again.',
ephemeral: true,
});
return;
}
await member.roles.add(IDs.roles.vegan.activist);
await member.roles.add(IDs.roles.vegan.nvAccess);
await interaction.reply({
content: 'Your access to the non vegan section has been given back successfully. '
content: 'Your access to the non vegan section has been given back. '
+ 'If you want to remove access again, click this button again.',
ephemeral: true,
});

View File

@ -28,6 +28,7 @@ const devIDs = {
vegan: {
vegan: '999431675098447937',
activist: '999431675098447934',
nvAccess: '1076859125415301141',
plus: '999431675010359460',
},
restrictions: {

View File

@ -31,6 +31,7 @@ let IDs = {
vegan: {
vegan: '788114978020392982',
activist: '730915638746546257',
nvAccess: '1076857105648209971',
plus: '798682625619132428',
},
restrictions: {