mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-11-02 08:37:39 +01:00
refactor(arabot): add blockedRolesAfterRestricted to restricted command
This commit is contained in:
parent
390af56fa5
commit
dcacffe908
@ -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);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user