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