Skip to content

Commit

Permalink
added memberlog default detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Battle committed Sep 2, 2020
1 parent e6db32a commit 0dd2ebe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/events/guildCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ module.exports = async (client, guild) => {
const modLog = guild.channels.cache.find(c => c.name.replace('-', '').replace('s', '') === 'modlog' ||
c.name.replace('-', '').replace('s', '') === 'moderatorlog');

// Find member log
const memberLog = guild.channels.cache.find(c => c.name.replace('-', '').replace('s', '') === 'memberlog');

// Find admin and mod roles
const adminRole =
guild.roles.cache.find(r => r.name.toLowerCase() === 'admin' || r.name.toLowerCase() === 'administrator');
Expand Down Expand Up @@ -82,6 +85,7 @@ module.exports = async (client, guild) => {
guild.systemChannelID, // Farewell channel
guild.systemChannelID, // Crown Channel
modLog ? modLog.id : null,
memberLog ? memberLog.id : null,
adminRole ? adminRole.id : null,
modRole ? modRole.id : null,
muteRole ? muteRole.id : null,
Expand Down
4 changes: 4 additions & 0 deletions src/events/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ module.exports = async (client) => {
// Find mod log
const modLog = guild.channels.cache.find(c => c.name.replace('-', '').replace('s', '') === 'modlog' ||
c.name.replace('-', '').replace('s', '') === 'moderatorlog');

// Find member log
const memberLog = guild.channels.cache.find(c => c.name.replace('-', '').replace('s', '') === 'memberlog');

// Find admin and mod roles
const adminRole =
Expand All @@ -48,6 +51,7 @@ module.exports = async (client) => {
guild.systemChannelID, // Farewell channel
guild.systemChannelID, // Crown Channel
modLog ? modLog.id : null,
memberLog ? memberLog.id : null,
adminRole ? adminRole.id : null,
modRole ? modRole.id : null,
muteRole ? muteRole.id : null,
Expand Down
3 changes: 2 additions & 1 deletion src/utils/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ const settings = {
farewell_channel_id,
crown_channel_id,
mod_log_id,
member_log_id,
admin_role_id,
mod_role_id,
mute_role_id,
crown_role_id
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
`),

// Selects
Expand Down

0 comments on commit 0dd2ebe

Please sign in to comment.