mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-19 05:54:15 +02:00
feat(arabot): add help command
This commit is contained in:
parent
7b74595bbe
commit
4f7dc865b0
46
src/commands/utils/help.ts
Normal file
46
src/commands/utils/help.ts
Normal file
@ -0,0 +1,46 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/*
|
||||
Animal Rights Advocates Discord Bot
|
||||
Copyright (C) 2023 Anthony Berg
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
import { Command } from '@sapphire/framework';
|
||||
import type { Message } from 'discord.js';
|
||||
|
||||
export class HelpCommand extends Command {
|
||||
public constructor(context: Command.Context, options: Command.Options) {
|
||||
super(context, {
|
||||
...options,
|
||||
name: 'help',
|
||||
description: 'Provides a list of all the commands from this bot',
|
||||
});
|
||||
}
|
||||
|
||||
// Registers that this is a slash command
|
||||
public override registerApplicationCommands(registry: Command.Registry) {
|
||||
registry.registerChatInputCommand((builder) => builder
|
||||
.setName(this.name)
|
||||
.setDescription(this.description));
|
||||
}
|
||||
|
||||
message = 'For a list of all the commands, visit: https://github.com/veganhacktivists/arabot/blob/main/docs/COMMANDS.md';
|
||||
|
||||
// Command run
|
||||
public async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
|
||||
return interaction.reply(this.message);
|
||||
}
|
||||
|
||||
public async messageRun(message: Message) {
|
||||
return message.channel.send(this.message);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user