-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
66 lines (53 loc) · 1.85 KB
/
app.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
66
const { Collection } = require("discord.js");
const { readdirSync } = require("fs");
const { TOKEN } = require("./bot.json");
const Toki = require("./lib/Client");
const client = new Toki({
fetchAllMembers: true,
disableEvents: [
"GUILD_SYNC",
"PRESENCE_UPDATE",
"TYPING_START"
]
});
// status
client.on('ready', () => {
console.log('Abandon all hope, ye who enter here..\nHosting ' + `${client.users.size}` + ' users, in ' + `${client.channels.size}` + ' channels of ' + `${client.guilds.size}` + ' guilds.');
client.user.setStatus('online')
function heystats() {
let status = [
"./hensuki",
"Senpai Dog",
"with Okita sensei",
"hensuki.now.sh",
"nhentai.net",
"codename: sayuki",
"ダイスキ。"
]
let statusR = Math.floor(Math.random() * status.length);
client.user.setActivity(status[statusR] , {type : "Playing" , status : "Idle"});
}
setInterval(heystats, 10000);
});
// main prefix
client.on('message', msg => {
if (msg.content === 'toki') {
msg.reply('hey your prefix: ```toki help```')
}
})
// events
for (const event of readdirSync("./events")) {
client.on(event.split(".")[0], (...args) => require(`./events/${event}`)(client, ...args));
}
// modules
client.commands = new Collection();
client.aliases = new Collection();
for (const command of (readdirSync(`./commands`).filter(x => x.endsWith(".js")))) {
let cmd = require(`./commands/${command}`);
client.commands.set(cmd.help.name.toLowerCase(), cmd);
// get aliases command
for (const alias of cmd.conf.aliases) {
client.aliases.set(alias.toLowerCase(), cmd.help.name.toLowerCase());
}
}
client.login(TOKEN);