-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbotMeta.js
More file actions
61 lines (56 loc) · 2.2 KB
/
botMeta.js
File metadata and controls
61 lines (56 loc) · 2.2 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
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
const { Client, GatewayIntentBits, Partials } = require('discord.js');
const { rateLimitLogger } = require('./lib/rateLimitLogger');
const bot = new Client({
intents: [ // Discord moment
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildBans,
GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.GuildIntegrations,
GatewayIntentBits.GuildWebhooks,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.DirectMessageTyping,
GatewayIntentBits.MessageContent,
],
partials: [
Partials.User,
Partials.Channel,
Partials.GuildMember,
Partials.Message,
Partials.Reaction
]
});
rateLimitLogger(bot);
bot.afkChecks = {};
bot.afkModules = {};
bot.settings = moduleIsAvailable('./guildSettings.json') ? require('./guildSettings.json') : {};
bot.settingsTimestamp = {};
bot.partneredServers = moduleIsAvailable('./data/partneredServers.json') ? require('./data/partneredServers.json') : [];
bot.fetchPartneredServer = function (guildId) {
for (const server of bot.partneredServers) {
if (server.guildId == guildId) return server;
}
return null;
};
bot.adminUsers = ['277636691227836419', '258286481167220738', '190572077219184650', '120540036855889921', '658783569191370802', '130850662522159104'];
bot.partneredServers = moduleIsAvailable('./data/partneredServers.json') ? require('./data/partneredServers.json') : {};
bot.emojiServers = moduleIsAvailable('./data/emojiServers.json') ? require('./data/emojiServers.json') : {};
bot.devServers = ['739623118833713214'];
bot.storedEmojis = moduleIsAvailable('./data/emojis.json') ? require('./data/emojis.json') : {};
function moduleIsAvailable(path) {
try {
require.resolve(path);
require(path);
return true;
} catch (e) {
return false;
}
}
module.exports = { bot };