Added hackban

This commit is contained in:
TheEssem 2019-11-06 11:31:31 -06:00
parent e0bae52309
commit 4439fca6d3
2 changed files with 14 additions and 2 deletions

12
commands/hackban.js Normal file
View File

@ -0,0 +1,12 @@
exports.run = async (message, args) => {
if (!args[0].match(/^\d+$/) && args[0] < 21154535154122752) return `${message.author.mention}, that's not a valid snowflake!`;
try {
await message.channel.guild.banMember(args[0], 0, `hackban command used by @${message.author.username}#${message.author.discriminator}`);
return `Successfully banned user with ID \`${args[0]}\`.`;
} catch (e) {
console.error(e);
return `${message.author.mention}, I was unable to kick the member. Have you given me permissions?`;
}
};
exports.aliases = ["prevent", "preban"];

View File

@ -3,9 +3,9 @@ const client = require("../utils/client.js");
exports.run = async (message) => {
if (message.member.voiceState.channelID) {
if (!message.channel.guild.members.get(client.user.id).permission.has("voiceConnect") || !message.channel.permissionsOf(client.user.id).has("voiceConnect")) return `${message.author.mention}, I can't join this voice channel!`;
if (message.author.id !== "198198681982205953") return "this command is for testing and is restricted to owners lol";
if (message.author.id !== "198198681982205953") return `${message.author.mention}, this command is for testing and is restricted to owners.`;
const voiceChannel = message.channel.guild.channels.get(message.member.voiceState.channelID);
client.createMessage(message.channel.id, "🔊 Playing music...");
client.createMessage(message.channel.id, "🔊 Playing...");
const connection = await voiceChannel.join();
connection.play(message.attachments[0].url, {
inlineVolume: true