-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
65 lines (51 loc) · 1.14 KB
/
server.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
65
//External dependencies
const commando = require("discord.js-commando")
const discordErrorHandler = require("discord.js-handles")
//Load info
const token = require("./token.json") //I'm an idiot - Thanks for the lesson
//Create new Discord client
const makeshiftbot = new commando.Client({
commandPrefix : "!",
unknownCommandResponse : false,
owner : "153595272465743872"
})
//Load and register commands.
require("./src/commands/index")(makeshiftbot)
let handlerOptions = {
logAllGuilds: false,
guilds: [],
name: "nova-public",
notify: {
users: [
"153595272465743872"
],
channels: []
}
}
discordErrorHandler(makeshiftbot, handlerOptions)
//Load custom modules
require("./src/modules/index")(makeshiftbot)
//*
//Start bot
makeshiftbot.login(token)
.catch(console.error)
//*/
makeshiftbot
.on("ready", () => {
setStatus(makeshiftbot.user)
})
.on("shardReady", () => {
setStatus(makeshiftbot.user)
})
.on("shardResume", ()=> {
setStatus(makeshiftbot.user)
})
.on("invalidated", ()=> setStatus(makeshiftbot.user))
function setStatus(user){
user.setPresence({
activity: {
name: "@Nova help",
type: "PLAYING"
}
})
}