add jokes kekw

This commit is contained in:
Ryan Cao 2022-08-30 21:28:56 +08:00
parent 4dd06821d1
commit 8c5b317e11
No known key found for this signature in database
GPG key ID: 528A2C1B6656B97F
3 changed files with 16 additions and 1 deletions

11
src/commands/joke.ts Normal file
View file

@ -0,0 +1,11 @@
import type { CacheType, ChatInputCommandInteraction } from 'discord.js';
export const jokeCommand = async (
i: ChatInputCommandInteraction<CacheType>
) => {
await i.deferReply();
const joke = await fetch('https://icanhazdadjoke.com', {
headers: { Accept: 'text/plain' },
}).then((r) => r.text());
await i.editReply(joke);
};