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

Commit

Permalink
Implement toggleable text channel logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kyogoi committed Oct 6, 2019
1 parent 488de35 commit 1f3185c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config.json.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"token": ""
"token": "",
"emitLog": true
}
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

const permissions = textChannel.permissionOverwrites.find((v) => v.id == oldMember.id);
if (permissions) permissions.delete();
if (config.emitLog) textChannel.send(`${oldMember} has left the voice channel.`);
}

// Dealing with a linked channel
Expand All @@ -51,6 +52,7 @@
db.run('UPDATE channels SET set_to_purge = 0 WHERE voice_id = ?', [newMember.voiceChannelID]);

textChannel.overwritePermissions(newMember, { "VIEW_CHANNEL": true });
if (config.emitLog) textChannel.send(`${newMember} has entered the voice channel.`);
}

});
Expand Down

0 comments on commit 1f3185c

Please sign in to comment.