-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
36 lines (29 loc) · 1.07 KB
/
index.js
File metadata and controls
36 lines (29 loc) · 1.07 KB
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
const { Client, SQLiteProvider } = require("disbull.js");
const sqlite = require("sqlite");
const path = require("path");
const oneLine = require("common-tags").oneLine;
const client = new Client({
owner: ["325414558623858698"],
commandPrefix: "s*",
token: "Njc2NjY2Njc2MjUwNDExMDA4"
});
sqlite.open(path.join(__dirname, "/Data/settings.sqlite3")).then(db => {
client.setProvider(new SQLiteProvider(db));
});
client.registry.registerCommandsIn(path.join(__dirname, "commands"));
client.registry.registerEventsIn(path.join(__dirname, "events"));
client.registry.registerLocalesIn(path.join(__dirname, "locales"));
client
.on("commandPrefixChange", (guild, prefix) => {
console.log(oneLine`
Prefix ${prefix === "" ? "removed" : `changed to ${prefix || "the default"}`}
${guild ? `in guild ${guild.name} (${guild.id})` : "globally"}.
`);
})
.on("localeChange", (guild, locale) => {
console.log(oneLine`
Locale ${locale ? `changed to ${locale}` : `changed to the default.`}
${guild ? `in guild ${guild.name} (${guild.id})` : "globally"}
`);
});
client.run();