Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Commit

Permalink
Add permissions check and bot ready logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kyogoi committed Oct 6, 2019
1 parent 6ef1b53 commit 488de35
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
if (!voiceChannel.members.length) {
db.run('UPDATE channels SET set_to_purge = 1 WHERE voice_id = ?', [oldMember.voiceChannelID]);
}

textChannel.permissionOverwrites.find((v) => v.id == oldMember.id).delete();

const permissions = textChannel.permissionOverwrites.find((v) => v.id == oldMember.id);
if (permissions) permissions.delete();
}

// Dealing with a linked channel
Expand All @@ -54,8 +55,12 @@

});

bot.once('ready', async () => {
setInterval(purgeAll, 1800000);
bot.once('ready', () => {
setInterval(purgeAll, 5000);
});

bot.on('ready', () => {
console.log(`[${[Date.now()]}] Bot connected!`);
});

bot.login(config.token);
Expand Down

0 comments on commit 488de35

Please sign in to comment.