tangled
alpha
login
or
join now
thevoid.cafe
/
voidy
0
fork
atom
A powerful and extendable Discord bot, with it's own module system :3
thevoid.cafe/projects/voidy
0
fork
atom
overview
issues
pulls
pipelines
✨ Add api.httpcat subcommand to test command assembler
thevoid.cafe
5 months ago
9c422393
181e8091
+25
1 changed file
expand all
collapse all
unified
split
packages
bot
src
modules
core
commands
api_httpcat.ts
+25
packages/bot/src/modules/core/commands/api_httpcat.ts
···
1
1
+
import { MessageFlags, SlashCommandSubcommandBuilder } from "discord.js";
2
2
+
import type { Command } from "voidy-framework";
3
3
+
4
4
+
export default {
5
5
+
id: "api.httpcat",
6
6
+
data: new SlashCommandSubcommandBuilder()
7
7
+
.setName("httpcat")
8
8
+
.setDescription("Fetch a cat from the https://http.cat API.")
9
9
+
.addStringOption(option => option
10
10
+
.setName("code")
11
11
+
.setDescription("The desirect HTTP status code.")
12
12
+
.setRequired(true)
13
13
+
),
14
14
+
15
15
+
execute: async (interaction, client) => {
16
16
+
const { options } = interaction;
17
17
+
18
18
+
const httpCode = options.getString("code");
19
19
+
20
20
+
await interaction.reply({
21
21
+
files: [`https://http.cat/${httpCode}.jpg`],
22
22
+
flags: [MessageFlags.Ephemeral]
23
23
+
});
24
24
+
}
25
25
+
} as Command