-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
44 lines (33 loc) · 1.51 KB
/
index.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
const Discord = require("discord.js")
const bot = new Discord.Client();
const prefix = '~'
bot.on("message", (message) => {
const lowMessage = message.content.toLowerCase();
if (!message.content.startsWith(prefix)) return;
let args = message.content.substring(prefix.length).split(" ");
switch (args[0].toLowerCase()) {
case "help":
message.channel.send(new Discord.RichEmbed()
.setDescription("To kno da wae, you must do ~showdawae." +
"That will show you da wae to you're different chat sections! REMINDER: " +
"This discord bot only works with chat channels ATM and will soon be compatible with voice channels");
)
break;
case "showdawae":
message.channel.send("I will show you da wae! spit spit spit")
message.channel.send(buildEmbed(message));
break;
}
});
const TOKEN = "***"
bot.login(TOKEN);
function buildEmbed(message){
const channelEmbed = new Discord.RichEmbed();
const channelObject = {};
message.guild.channels.array().forEach( (channel) => channelObject[channel.id] = channel);
for(channel in channelObject){
const currChannel = channelObject[channel];
channelEmbed.addField(currChannel.name,`Link: ${currChannel.toString()} \n Description: ${currChannel.topic}`);
}
return channelEmbed;
}