More restructuring
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import type { Message } from "discord.js";
|
||||
import type { Command } from "../service";
|
||||
import Chan from "../../util/chan";
|
||||
|
||||
export default {
|
||||
name: "chan",
|
||||
description: "Get random media from a 4chan board.",
|
||||
usage: ".chan <board> [search]",
|
||||
execute: async (message: Message) => {
|
||||
const [, board, search] = message.content.split(/\s+/);
|
||||
|
||||
if (!board) {
|
||||
await message.reply("Usage: .chan <board> [search]")
|
||||
return;
|
||||
};
|
||||
|
||||
if (Chan.isNsfwBoard(board)) {
|
||||
await message.reply("Fuck off nigger")
|
||||
return;
|
||||
};
|
||||
|
||||
await message.reply(await Chan.getMediaLink(board, search));
|
||||
}
|
||||
} satisfies Command;
|
||||
Reference in New Issue
Block a user