mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 13:53:12 +02:00
Allow modlog channel to be swapped
This commit is contained in:
@@ -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('<modlog>')) 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})?`);
|
||||
|
||||
@@ -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('<modlog>')) 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})?`);
|
||||
|
||||
@@ -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('<modlog>')) 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})?`);
|
||||
|
||||
@@ -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('<modlog>')) 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.');
|
||||
|
||||
@@ -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('<modlog>')) 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, {
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
<div class="xiaobox2">
|
||||
<h2>Notes</h2>
|
||||
<ol>
|
||||
<li>Moderation commands require a channel named mod-log to send Ban/Kick/Softban/Unban/Warn logs.</li>
|
||||
<li>Moderation commands require a channel with <modlog> in the topic to send Ban/Kick/Softban/Unban/Warn logs.</li>
|
||||
<li>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></li>
|
||||
<li>To use invite guard, place <inviteguard> in the default channel topic.</li>
|
||||
<li>Use x;help to view a command list</li>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</ol>
|
||||
<h2>Notes</h2>
|
||||
<ol>
|
||||
<li>Moderation commands require a channel named mod-log to send Ban/Kick/Softban/Unban/Warn logs.</li>
|
||||
<li>Moderation commands require a channel with <modlog> in the topic to send Ban/Kick/Softban/Unban/Warn logs.</li>
|
||||
<li>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></li>
|
||||
<li>To use invite guard, place <inviteguard> in the default channel topic.</li>
|
||||
<li>Use x;help to view a command list</li>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "25.1.1",
|
||||
"version": "25.2.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Shard.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user