-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBadBot.js
53 lines (47 loc) · 1.83 KB
/
BadBot.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const Discord = require("discord.js");
const client = new Discord.Client();
const prefix = ("!");
client.on('ready', ready => {
console.log("I'm ready")
})
client.on('message', message => {
if(message.content.startsWith(prefix + "move")) {
if(message.author.id !== "268478587651358721") {
var trieduser = message.author;
botRepliesArray.forEach(function(item, index, array) {
return message.channel.send("Authorized users only. " + trieduser)
if(message.author.bot) return;
})
}
let getMentions = message.mentions.members.array();
let messageContent = message.content.split(" ").slice(-1)[0];
getMentions.forEach(function(item, index, array) {
var channel = message.guild.channels.find('name', messageContent);
message.guild.member(item).setVoiceChannel(channel);
});
}
});
client.on('message', message => {
if(message.author.id !== "268478587651358721") {
var trieduser = message.author;
botRepliesArray.forEach(function(item, index, array) {
return message.channel.send("Authorized users only. " + trieduser)
if(message.author.bot) return;
})
}
if(message.content.startsWith(prefix + "moveall")) {
var channelMembers;
var channelNameMember;
var getChannels = message.guild.channels.array();
getChannels.forEach(function(item, index, array) {
channelMembers = item.members.array();
channelMembers.forEach(function(item, index, array) {
channelNameMember = item.id
let messageContent = message.content.split(" ").slice(-1)[0];
var channel = message.guild.channels.find('name', messageContent);
message.guild.member(channelNameMember).setVoiceChannel(channel);
})
})
}
});
client.login('Your Bot Token Here');