-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
64 lines (45 loc) · 1.89 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const { play, stop, summon, dev, lista, taylor, add, next, qClean} = require ('./commands')
const { Client } = require ('discord.js');
const bot = new Client();
const token = "Nzc5NjkwMDkyNDAyOTY2NTM5.X7kM-w.MleswaPkNrxZrXUsjc5JMGxN-0I";
bot.login(token)
bot.on("ready", () =>{
var textChannel = bot.channels.cache.get("676917684130283541");
textChannel.send("Fala aí galera, estou em fase de desenvolvimento, cuidado comigo, estou online!")
});
bot.on("message", msg => {
if (msg.author.bot) return;
const prefix = '!';
if(!msg.content.startsWith(prefix)) return;
const commandName = getCommandName(prefix, msg.content);
const args = getCommandArgs(prefix, msg.content);
if(commandName.toLowerCase() === '!play' || commandName.toLowerCase() ==="!p")
return play(msg,args);
if(commandName.toLowerCase() === '!add' || commandName.toLowerCase() ==="!a")
return add(msg,args);
if (commandName.toLowerCase() === '!stop' || commandName.toLowerCase() ==="!s")
return stop(msg);
if (commandName.toLowerCase() === '!queueclean' || commandName.toLowerCase() ==="!qc")
return qClean(msg);
if (commandName.toLowerCase() === '!next' || commandName.toLowerCase() ==="!n")
return next(msg,args);
if(commandName.toLowerCase() === '!summon')
return summon(msg);
if(commandName.toLowerCase() === "!dev" || commandName.toLowerCase() ==="!d")
return dev(msg);
if(commandName.toLowerCase() === '!queue' || commandName.toLowerCase() ==="!q")
return lista(msg);
if(commandName.toLowerCase() === "!taylor")
return taylor(msg);
});
function getCommandName(prefix, content){
return content
.slice(prefix.lenght)
.split(' ')[0];
}
function getCommandArgs(prefix, content) {
return content
.slice(prefix.lenght)
.split(' ')
.slice(1);
}