-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
55 lines (46 loc) · 1.31 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
const Discord = require('discord.js');
const client = new Discord.Client();
var token = require('./token.json');
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if(msg.author.bot){ // Ignore messages from other bots
return;
}
if(msg.mentions.users.array().includes(client.user)){
msg.channel.send("Thanks for the ping!");
return;
}
if(msg.content.startsWith("!")){
if(msg.content.startsWith("!date")){
var d = new Date();
msg.channel.send(d.getDate());
return;
}
if(msg.content.startsWith("!help")){
msg.author.send("help is coming");
return;
}
if(msg.content.startsWith("!logo"))
{
// send a discord logo
msg.channel.send("Here ya go",
{
files:["https://hacksocnotts.co.uk/static/media/logo.a84dfc55.png"]
});
return;
}
if(msg.content.startsWith("!localfile"))
{
// send a discord logo
msg.channel.send("One Local file, coming up",
{
files:[{attachment: "cheese.txt", name:"test.js"}]
});
return;
}
msg.channel.send("Unknown Command, send `!help` for documentation");
}
});
client.login(token["token"]);