forked from TrashMonks/Ereshkigal-Old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisboard.js
26 lines (22 loc) · 1.3 KB
/
disboard.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
function PublicBumpReminder(config, message) {
if(!config || !config.disboardChannelId || !config.botChannelId || message.channel.type != 'text') { return; }
const permsRequired = ['VIEW_CHANNEL', 'MANAGE_CHANNELS', 'MANAGE_ROLES', 'SEND_MESSAGES'];
if (!message.guild.me.hasPermission(permsRequired)) {
return message.channel.send('Sorry, I don\'t have all the necessary permissions (' + permsRequired.join(', ') + ')');
}
if(message.author.bot && message.author.id == '302050872383242240' && message.content.includes('Bump done')) {
const bumpChannel = message.guild.channels.resolve(config.disboardChannelId);
const botChannel = message.guild.channels.resolve(config.botChannelId);
// const disboardBot = message.guild.member('265668852275216384');
botChannel.updateOverwrite(message.author, { 'VIEW_CHANNEL': false },
'Disboard Bump Cooldown');
bumpChannel.send('Server bumped! The next reminder will be in **8 hours**');
setTimeout(function() {
bumpChannel.send(`It's been 8 hours! The server can be bumped on Disboard again using \`!d bump\` in <#${config.botChannelId}>`);
message.channel.updateOverwrite(message.author, { 'VIEW_CHANNEL': true },
'Disboard Bump Cooldown');
}, 28800 * 1000);
return;
}
}
exports.BumpReminder = PublicBumpReminder;