diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index c15319d1..9def04a7 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -33,7 +33,11 @@ module.exports = class BanCommand extends Command { } async run(msg, args) { - const modlogs = msg.guild.channels.find('name', 'mod-log'); + const modlogs = msg.guild.channels.filter((c) => { + const topic = c.topic || ''; + if (topic.includes('')) return true; + else return false; + }).first() || member.guild.channels.find('name', 'mod-log'); const { member, reason } = args; if (!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?'); await msg.say(`Are you sure you want to ban ${member.user.tag} (${member.id})?`); diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index f7313025..d16b4564 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -33,7 +33,11 @@ module.exports = class KickCommand extends Command { } async run(msg, args) { - const modlogs = msg.guild.channels.find('name', 'mod-log'); + const modlogs = msg.guild.channels.filter((c) => { + const topic = c.topic || ''; + if (topic.includes('')) return true; + else return false; + }).first() || member.guild.channels.find('name', 'mod-log'); const { member, reason } = args; if (!member.kickable) return msg.say('This member is not kickable. Perhaps they have a higher role than me?'); await msg.say(`Are you sure you want to kick ${member.user.tag} (${member.id})?`); diff --git a/commands/moderation/softban.js b/commands/moderation/softban.js index 70ab1acb..8e6c51d3 100644 --- a/commands/moderation/softban.js +++ b/commands/moderation/softban.js @@ -33,7 +33,11 @@ module.exports = class SoftbanCommand extends Command { } async run(msg, args) { - const modlogs = msg.guild.channels.find('name', 'mod-log'); + const modlogs = msg.guild.channels.filter((c) => { + const topic = c.topic || ''; + if (topic.includes('')) return true; + else return false; + }).first() || member.guild.channels.find('name', 'mod-log'); const { member, reason } = args; if (!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?'); await msg.say(`Are you sure you want to softban ${member.user.tag} (${member.id})?`); diff --git a/commands/moderation/unban.js b/commands/moderation/unban.js index e5fcca6c..7448eec7 100644 --- a/commands/moderation/unban.js +++ b/commands/moderation/unban.js @@ -33,7 +33,11 @@ module.exports = class UnbanCommand extends Command { } async run(msg, args) { - const modlogs = msg.guild.channels.find('name', 'mod-log'); + const modlogs = msg.guild.channels.filter((c) => { + const topic = c.topic || ''; + if (topic.includes('')) return true; + else return false; + }).first() || member.guild.channels.find('name', 'mod-log'); const { id, reason } = args; const bans = await msg.guild.fetchBans(); if (!bans.has(id)) return msg.say('This ID is not in the Guild Banlist.'); diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index b65c11de..157b395c 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -32,7 +32,11 @@ module.exports = class WarnCommand extends Command { } async run(msg, args) { - const modlogs = msg.guild.channels.find('name', 'mod-log'); + const modlogs = msg.guild.channels.filter((c) => { + const topic = c.topic || ''; + if (topic.includes('')) return true; + else return false; + }).first() || member.guild.channels.find('name', 'mod-log'); const { member, reason } = args; await msg.say(`Are you sure you want to warn ${member.user.tag} (${member.id})?`); const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { diff --git a/html/carbonuse.html b/html/carbonuse.html index 2729cec4..32daaa34 100644 --- a/html/carbonuse.html +++ b/html/carbonuse.html @@ -12,7 +12,7 @@

Notes

    -
  1. Moderation commands require a channel named mod-log to send Ban/Kick/Softban/Unban/Warn logs.
  2. +
  3. Moderation commands require a channel with <modlog> in the topic to send Ban/Kick/Softban/Unban/Warn logs.
  4. To use member join/leave logging, place <memberlog> in the channel topic. Custom messages can be set with <joinmessage>messagegoeshere</joinmessage> and <leavemessage>messagegoeshere</leavemessage>
  5. To use invite guard, place <inviteguard> in the default channel topic.
  6. Use x;help to view a command list
  7. diff --git a/html/discordbots.html b/html/discordbots.html index 3057ac60..67a5a36f 100644 --- a/html/discordbots.html +++ b/html/discordbots.html @@ -67,7 +67,7 @@

Notes

    -
  1. Moderation commands require a channel named mod-log to send Ban/Kick/Softban/Unban/Warn logs.
  2. +
  3. Moderation commands require a channel with <modlog> in the topic to send Ban/Kick/Softban/Unban/Warn logs.
  4. To use member join/leave logging, place <memberlog> in the channel topic. Custom messages can be set with <joinmessage>messagegoeshere</joinmessage> and <leavemessage>messagegoeshere</leavemessage>
  5. To use invite guard, place <inviteguard> in the default channel topic.
  6. Use x;help to view a command list
  7. diff --git a/package.json b/package.json index 1fb66372..44cac552 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "25.1.1", + "version": "25.2.0", "description": "Your personal server companion.", "main": "Shard.js", "scripts": {