From 4439fca6d31a9b3f59daaab5319a4a2cd8e9775f Mon Sep 17 00:00:00 2001 From: TheEssem Date: Wed, 6 Nov 2019 11:31:31 -0600 Subject: [PATCH] Added hackban --- commands/hackban.js | 12 ++++++++++++ commands/play.js | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 commands/hackban.js diff --git a/commands/hackban.js b/commands/hackban.js new file mode 100644 index 0000000..a4aeae2 --- /dev/null +++ b/commands/hackban.js @@ -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"]; \ No newline at end of file diff --git a/commands/play.js b/commands/play.js index 0ad557e..bec13c2 100644 --- a/commands/play.js +++ b/commands/play.js @@ -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