Skip to content

Commit 8ee2ac0

Browse files
committed
add random image command
1 parent 0969437 commit 8ee2ac0

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import * as Discord from "discord.js";
2+
import { SlashCommand } from "@/extensions/discord.js";
3+
import { Shat } from "../shitposting.js";
4+
5+
export const SlashRandomImageCommand: SlashCommand = {
6+
options: {
7+
name: "randomimage",
8+
description: "post a random image from the time machine...",
9+
},
10+
execute: async ctx => {
11+
await ctx.deferReply();
12+
13+
const res = await Shat({ forceImage: true });
14+
15+
if (res) {
16+
await ctx.followUp(res as Discord.InteractionReplyOptions);
17+
} else {
18+
await ctx.deleteReply();
19+
}
20+
},
21+
};

app/services/discord/modules/commands/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ import { SlashGservCommand } from "./developer/Gserv.js";
1717
import { SlashKickCommand } from "./developer/Kick.js";
1818
import { SlashLuaCommand } from "./developer/Lua.js";
1919
import { SlashMarkovCommand } from "./Markov.js";
20+
import { SlashRandomImageCommand } from "./Shitposting.js";
2021
import { SlashRconCommand } from "./developer/Rcon.js";
2122
import { SlashRefreshLuaCommand } from "./developer/RefreshLua.js";
2223
import { SlashRoleCommand } from "./Role.js";
2324
import { SlashRuleCommand } from "./developer/Rules.js";
24-
import { SlashSQLCommand } from "./developer/SQL.js";
2525
import { SlashSpeechbubbleCommand } from "./Speechbubble.js";
26+
import { SlashSQLCommand } from "./developer/SQL.js";
2627
import { SlashUnBanCommand } from "./developer/UnBan.js";
2728
import { SlashVoiceCommand } from "./TempVoiceChannel.js";
2829
import { SlashWhyBanCommand } from "./WhyBan.js";
@@ -46,6 +47,7 @@ export const slashCommands = [
4647
SlashDeeplCommand,
4748
SlashMarkovCommand,
4849
SlashRoleCommand,
50+
SlashRandomImageCommand,
4951
SlashSpeechbubbleCommand,
5052
SlashVoiceCommand,
5153
SlashWhyBanCommand,

0 commit comments

Comments
 (0)