Skip to content

Commit b3fa3a0

Browse files
refactor: rename muted role
1 parent 10c037d commit b3fa3a0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/modules/quoiFeur/quoiFeur.helpers.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { cache } from '../../core/cache';
1111
import { removeEmoji, removePunctuation } from '../../helpers/regex.helper';
1212

1313
const ONE_MINUTE = 1 * 60 * 1000;
14-
const MUTED_BY_BOT = 'Muted by bot';
14+
const MUTED_ON_COUBEH = 'Muted on Coubeh';
1515

1616
const quoiDetectorRegex = /\bquoi\s*$/i;
1717
const endWithQuoi = (text: string) => quoiDetectorRegex.test(removeEmoji(removePunctuation(text)));
@@ -32,7 +32,7 @@ const reactWithCoubeh = async (message: Message) => {
3232
await message.react('🇭');
3333
await message.react('🔇');
3434

35-
const mutedRole = message.guild?.roles.cache.find((r) => r.name === MUTED_BY_BOT);
35+
const mutedRole = message.guild?.roles.cache.find((r) => r.name === MUTED_ON_COUBEH);
3636

3737
if (!mutedRole?.id) return;
3838

@@ -63,20 +63,20 @@ export const createRoleMutedByBot = async (guild: Guild | null): Promise<Role> =
6363
if (!guild) {
6464
throw new Error('Guild is null in createRoleMutedByBot');
6565
}
66-
const existingMutedByBot = guild.roles.cache.find((role) => role.name === MUTED_BY_BOT);
66+
const existingMutedByBot = guild.roles.cache.find((role) => role.name === MUTED_ON_COUBEH);
6767

6868
return (
6969
existingMutedByBot ??
7070
guild.roles.create({
71-
name: MUTED_BY_BOT,
71+
name: MUTED_ON_COUBEH,
7272
})
7373
);
7474
};
7575

7676
export const deleteRoleMutedByBot = async (client: Client<true>): Promise<void> => {
7777
const guilds = await client.guilds.fetch().then((guilds) => guilds.map((guild) => guild.fetch()));
7878
const roles = await Promise.all(guilds).then((guilds) =>
79-
guilds.map((guild) => guild.roles.cache.find((role) => role.name === MUTED_BY_BOT)),
79+
guilds.map((guild) => guild.roles.cache.find((role) => role.name === MUTED_ON_COUBEH)),
8080
);
8181

8282
for (const role of roles) {
@@ -118,7 +118,7 @@ export const removeQuoiFeurFromChannel = async (interaction: ChatInputCommandInt
118118
return;
119119
}
120120

121-
const role = interaction.guild?.roles.cache.find((r) => r.name === MUTED_BY_BOT);
121+
const role = interaction.guild?.roles.cache.find((r) => r.name === MUTED_ON_COUBEH);
122122
if (role) {
123123
await channel.permissionOverwrites.delete(role);
124124
}

0 commit comments

Comments
 (0)