refactor(arabot): add blockedRolesAfterRestricted to restricted command

This commit is contained in:
smyalygames 2023-03-08 00:26:51 +00:00
parent 390af56fa5
commit dcacffe908
3 changed files with 5 additions and 13 deletions

View File

@ -40,6 +40,7 @@ import IDs from '#utils/ids';
import { addEmptyUser, updateUser, fetchRoles } from '#utils/database/dbExistingUser';
import { restrict, checkActive } from '#utils/database/restriction';
import { randint } from '#utils/maths';
import { blockedRolesAfterRestricted } from '#utils/blockedRoles';
export async function restrictRun(
userId: Snowflake,
@ -205,16 +206,7 @@ export async function restrictRun(
await restrictedChannel.send({ embeds: [embed] });
}
await member.roles.remove([
IDs.roles.vegan.vegan,
IDs.roles.vegan.plus,
IDs.roles.vegan.activist,
IDs.roles.vegan.nvAccess,
IDs.roles.trusted,
IDs.roles.nonvegan.nonvegan,
IDs.roles.nonvegan.convinced,
IDs.roles.nonvegan.vegCurious,
]);
await member.roles.remove(blockedRolesAfterRestricted);
} else {
await addEmptyUser(userId);
const dbRoles = await fetchRoles(userId);

View File

@ -29,7 +29,7 @@ import { ChannelType } from 'discord.js';
import { fetchRoles, getLeaveRoles } from '#utils/database/dbExistingUser';
import { blockTime } from '#utils/database/verification';
import { checkActive, getSection } from '#utils/database/restriction';
import { blockedRoles, blockedRestrictedRoles } from '#utils/blockedRoles';
import { blockedRoles, blockedRolesAfterRestricted } from '#utils/blockedRoles';
import IDs from '#utils/ids';
export class RolesJoinServerListener extends Listener {
@ -148,6 +148,6 @@ export class RolesJoinServerListener extends Listener {
}
private blockedRestrictedRole(role: Snowflake) {
return !blockedRestrictedRoles.includes(role);
return !blockedRolesAfterRestricted.includes(role);
}
}

View File

@ -30,7 +30,7 @@ export const blockedRoles = [
IDs.roles.stageHost,
];
export const blockedRestrictedRoles = [
export const blockedRolesAfterRestricted = [
IDs.roles.vegan.vegan,
IDs.roles.vegan.plus,
IDs.roles.vegan.activist,