mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-23 11:11:04 +00:00
feat(bot-discord): more support mute features(#19)
This commit is contained in:
28
apps/bot-discord/src/msgCommands/exile.js
Normal file
28
apps/bot-discord/src/msgCommands/exile.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import exileMemberToChannel from '../utils/exileMemberToChannel.js';
|
||||
import { checkForPerms } from '../utils/checkSupporterPerms.js'
|
||||
import muteMember from '../utils/muteMember.js';
|
||||
|
||||
export default {
|
||||
name: 'exile',
|
||||
async execute(msg, args, config) {
|
||||
if (!checkForPerms(config, message.member)) return msg.reply('You don\'t have the permission to do this.');
|
||||
|
||||
if (!msg.reference) return msg.reply('You did not reply to anyone!');
|
||||
const referencedMsg = await msg.channel.messages.fetch(msg.reference.messageId);
|
||||
let message = referencedMsg.content;
|
||||
if (args[0]) {
|
||||
if (isNaN(args[0])) return msg.reply('The argument you entered is not a number!');
|
||||
|
||||
const msgsByAuthor = (await msg.channels.fetch({ limit: 50 })).filter(
|
||||
m => m.author.id === referencedMsg.author.id
|
||||
);
|
||||
message = msgsByAuthor.slice(Number(`-${args[0]}`));
|
||||
}
|
||||
|
||||
await muteMember(config, referencedMsg.author, {
|
||||
supportMute: true
|
||||
});
|
||||
|
||||
exileMemberToChannel(referencedMsg.author, msg.channel, message, config, false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user