-
-
Notifications
You must be signed in to change notification settings - Fork 99
/
Pogy.js
62 lines (57 loc) · 1.7 KB
/
Pogy.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
const { Client, Collection } = require("discord.js");
const Util = require("./src/structures/Util");
const config = require("./config.json");
const { status } = config;
module.exports = class PogyClient extends Client {
constructor(options = {}) {
super({
partials: ["MESSAGE", "CHANNEL", "REACTION", "GUILD_MEMBER", "USER"],
intents: [
"GUILDS",
"GUILD_MEMBERS",
"GUILD_MESSAGES",
"GUILD_EMOJIS_AND_STICKERS",
"GUILD_MESSAGE_REACTIONS",
"GUILD_VOICE_STATES",
"GUILD_PRESENCES",
],
allowedMentions: {
parse: ["roles", "users", "everyone"],
repliedUser: true,
},
presence: {
status: "online",
activities: [
{
type: "WATCHING",
name: status,
},
],
},
});
this.validate(options);
this.botCommands = new Collection();
this.botEvents = new Collection();
this.aliases = new Collection();
this.utils = require("./src/utils/utils.js");
this.mongoose = require("./src/utils/mongoose");
this.utils = new Util(this);
this.config = require("./config.json");
}
validate(options) {
if (typeof options !== "object")
throw new TypeError("Options should be a type of Object.");
if (!options.prefix)
throw new Error("You must pass a prefix for the client.");
if (typeof options.prefix !== "string")
throw new TypeError("Prefix should be a type of String.");
this.prefix = options.prefix;
}
async start(token) {
require("./src/utils/prototypes");
await this.utils.loadCommands();
await this.utils.loadEvents();
await this.mongoose.init();
this.login(token);
}
};