Added hackban
This commit is contained in:
parent
e0bae52309
commit
4439fca6d3
2 changed files with 14 additions and 2 deletions
12
commands/hackban.js
Normal file
12
commands/hackban.js
Normal 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"];
|
|
@ -3,9 +3,9 @@ const client = require("../utils/client.js");
|
||||||
exports.run = async (message) => {
|
exports.run = async (message) => {
|
||||||
if (message.member.voiceState.channelID) {
|
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.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);
|
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();
|
const connection = await voiceChannel.join();
|
||||||
connection.play(message.attachments[0].url, {
|
connection.play(message.attachments[0].url, {
|
||||||
inlineVolume: true
|
inlineVolume: true
|
||||||
|
|
Loading…
Reference in a new issue