Add say command (#446)
- Add `/say` command to let the bot reply with a message - Migrate to yarn #19 Reviewed-on: #446 Reviewed-by: VylpesTester <tester@vylpes.com> Co-authored-by: Ethan Lane <ethan@vylpes.com> Co-committed-by: Ethan Lane <ethan@vylpes.com>
This commit is contained in:
parent
7ccfa34562
commit
b1afc79dda
8 changed files with 4709 additions and 8843 deletions
|
@ -93,7 +93,7 @@ export default class Audits extends Command {
|
|||
private async SendAuditForUser(interaction: CommandInteraction) {
|
||||
if (!interaction.guildId) return;
|
||||
|
||||
const user = interaction.options.getUser('target');
|
||||
const user = interaction.options.get('target', true).user!;
|
||||
|
||||
if (!user) {
|
||||
await interaction.reply("User not found.");
|
||||
|
@ -191,7 +191,7 @@ export default class Audits extends Command {
|
|||
private async AddAudit(interaction: CommandInteraction) {
|
||||
if (!interaction.guildId) return;
|
||||
|
||||
const user = interaction.options.getUser('target');
|
||||
const user = interaction.options.get('target', true).user!;
|
||||
const auditType = interaction.options.get('type');
|
||||
const reasonInput = interaction.options.get('reason');
|
||||
|
||||
|
@ -209,4 +209,4 @@ export default class Audits extends Command {
|
|||
|
||||
await interaction.reply(`Created new audit with ID \`${audit.AuditId}\``);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
24
src/commands/say.ts
Normal file
24
src/commands/say.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, CommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js";
|
||||
import EmbedColours from "../constants/EmbedColours";
|
||||
import { Command } from "../type/command";
|
||||
|
||||
export default class Say extends Command {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.CommandBuilder = new SlashCommandBuilder()
|
||||
.setName('say')
|
||||
.setDescription('Have the bot reply with your message')
|
||||
.addStringOption(x =>
|
||||
x
|
||||
.setName("message")
|
||||
.setDescription("The message to repeat")
|
||||
.setRequired(true));
|
||||
}
|
||||
|
||||
public override async execute(interaction: CommandInteraction) {
|
||||
const message = interaction.options.get("message", true);
|
||||
|
||||
await interaction.reply(message.value as string);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue