-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.js
86 lines (85 loc) · 2.95 KB
/
config.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
const config = {
description: 'I shouldnt really exist', // Description of the bot
name: 'Swordbot', // The bot name
devs: ['248540313059196928', '320546614857170945'], // Array of level 42 users - Sword#0042, Toast#6582
sets: {
// Settings
prefix: '_',
devPrefix: '-',
},
permLevels: [
// Permissions
{
level: 0, // Basic level command; return true automatically so all users can run commands
name: 'User',
check: () => true,
},
{
level: 2, // Moderator
name: 'Server Mod',
check: (message) => {
try {
const perms = message.member.permissions;
return perms.has('KICK_MEMBERS', true);
} catch (e) {
// TODO: Add error reporting for these catch blocks
return false;
}
},
},
{
level: 3, // Admin
name: 'Server Admin',
check: (message) => {
try {
const perms = message.member.permissions;
return perms.has('MANAGE_SERVERS', true);
} catch (e) {
return false;
}
},
},
{
level: 5, // Guild Owner
name: 'Server Owner',
check: (message) => {
try {
const result = message.channel.type === 'text' ? message.guild.ownerID === message.author.id : false;
return result;
} catch (e) {
return false;
}
},
},
{
level: 7, // Support
name: 'Support Team',
check: (message) => {
try {
// For this, we get the guild, then the member of the guild, and then finally check if that guild member A) Exists in the guild and B) Check if the guild member has the team role.
const guild = message.client.guilds.fetch('808408236235554816');
const guildMember = guild.members.fetch(message.author.id);
if (guildMember === undefined) return false;
const hasRole = guildMember.roles.cache.has('808408621833519127'); // Check for the project team role
return hasRole;
} catch (e) {
return false;
}
},
},
{
// For bot dev members
level: 42,
name: 'Bot Dev',
// checks if the message author is a member of the developers array.
check: (message) => {
if (config.devs.indexOf(message.author.id) > -1) {
return true;
} else {
return false;
}
},
},
],
};
module.exports = config;