mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 14:55:40 +02:00
Portal and Setting Help Commands
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class PortalSendCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'portal-send',
|
||||
group: 'random',
|
||||
memberName: 'portal-send',
|
||||
description: 'Send a message to a random channel that has a portal open.',
|
||||
args: [
|
||||
{
|
||||
key: 'message',
|
||||
prompt: 'What message do you want to send?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { message } = args;
|
||||
const channel = this.client.channels.filter((c) => {
|
||||
if (!c.topic || !c.permissionsFor(this.client.user).has('SEND_MESSAGES')) return false;
|
||||
else if (c.topic.includes('<portal>')) return true;
|
||||
else return false;
|
||||
}).random();
|
||||
if (!channel) return msg.say('Aww... No channel has an open portal...');
|
||||
try {
|
||||
await channel.send(message);
|
||||
return msg.say('Message sent!');
|
||||
} catch (err) {
|
||||
return msg.say('Failed to send message...');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class SettingHelpCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'setting-help',
|
||||
group: 'util',
|
||||
memberName: 'setting-help',
|
||||
description: 'View help on how to set up settings.',
|
||||
guarded: true
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say(stripIndents`
|
||||
**Invite Guard:** Place \`<inviteguard>\` in your default channel's topic. (${msg.guild.defaultChannel})
|
||||
**Mod Log Channel:** Place \`<modlog>\` in a channel's topic.
|
||||
**Portal Channel:** Place \`<portal>\` in a channel's topic.
|
||||
**Member Log Channel:** Place \`<memberlog>\` in a channel's topic.
|
||||
**Custom Join Message:** Place \`<joinmessage>message</joinmessage>\` in the Member Log's Channel.
|
||||
**Custom Leave Message:** Place \`<leavemessage>message</leavemessage>\` in the Member Log's Channel.
|
||||
`);
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "25.2.0",
|
||||
"version": "25.3.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Shard.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user