mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-05-10 10:43:06 +00:00
feat: add kick, mute, and unmute commands
This commit is contained in:
parent
49d274f2be
commit
20af09b279
8 changed files with 395 additions and 7 deletions
|
@ -6,7 +6,7 @@ import {
|
|||
} from 'discord.js';
|
||||
|
||||
import { updateMember, setMembers } from '@/db/db.js';
|
||||
import { generateMemberBanner } from '@/util/helpers.js';
|
||||
import { executeUnmute, generateMemberBanner } from '@/util/helpers.js';
|
||||
import { loadConfig } from '@/util/configLoader.js';
|
||||
import { Event } from '@/types/EventTypes.js';
|
||||
import logAction from '@/util/logging/logAction.js';
|
||||
|
@ -144,6 +144,21 @@ export const memberUpdate: Event<typeof Events.GuildMemberUpdate> = {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
oldMember.communicationDisabledUntil !==
|
||||
newMember.communicationDisabledUntil &&
|
||||
newMember.communicationDisabledUntil === null
|
||||
) {
|
||||
executeUnmute(
|
||||
newMember.client,
|
||||
guild.id,
|
||||
newMember.user.id,
|
||||
undefined,
|
||||
guild.members.me!,
|
||||
true,
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error handling member update:', error);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue