mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-28 05:31:03 +00:00
feat(bot-discord): mute and unmute command
This commit is contained in:
20
apps/bot-discord/src/events/guildMemberAdd.js
Normal file
20
apps/bot-discord/src/events/guildMemberAdd.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Events } from 'discord.js';
|
||||
|
||||
export default {
|
||||
name: Events.GuildMemberAdd,
|
||||
once: false,
|
||||
async execute(_, config, member) {
|
||||
const mute = await client.db.collection('mute').findOne({
|
||||
guild_id: member.guild.id,
|
||||
user_id: member.id
|
||||
});
|
||||
|
||||
if (mute) {
|
||||
// Add the roles given.
|
||||
member.roles.add(mute.support_mute ?
|
||||
config.mute.supportGiveRoles :
|
||||
config.mute.giveRoles
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user