mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 13:43:06 -04:00
add garfield
This commit is contained in:
parent
83a4e77166
commit
119955f04f
1 changed files with 42 additions and 0 deletions
42
commands/interaction/slash/fun/garfield.js
Normal file
42
commands/interaction/slash/fun/garfield.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
const { garfield } = require('#api');
|
||||
const { FUNNY_CAT_ICONS, PERMISSION_GROUPS } = require('#constants');
|
||||
|
||||
const { createEmbed } = require('#utils/embed');
|
||||
const { acknowledge } = require('#utils/interactions');
|
||||
const { timestamp } = require('#utils/markdown');
|
||||
const { editOrReply } = require('#utils/message')
|
||||
const {InteractionContextTypes, ApplicationIntegrationTypes, ApplicationCommandOptionTypes} = require("detritus-client/lib/constants");
|
||||
|
||||
module.exports = {
|
||||
description: 'Shows a random Garfield comic strip.',
|
||||
name: 'garfield',
|
||||
contexts: [
|
||||
InteractionContextTypes.GUILD,
|
||||
InteractionContextTypes.PRIVATE_CHANNEL,
|
||||
InteractionContextTypes.BOT_DM
|
||||
],
|
||||
integrationTypes: [
|
||||
ApplicationIntegrationTypes.USER_INSTALL
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: 'incognito',
|
||||
description: 'Makes the response only visible to you.',
|
||||
type: ApplicationCommandOptionTypes.BOOLEAN,
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
],
|
||||
run: async (context, args) => {
|
||||
await acknowledge(context, args.incognito, [...PERMISSION_GROUPS.baseline_slash]);
|
||||
|
||||
const garf = (await garfield()).response.body
|
||||
|
||||
return editOrReply(context, createEmbed("default", context, {
|
||||
description: `${FUNNY_CAT_ICONS[Math.floor(Math.random() * FUNNY_CAT_ICONS.length)]} Garfield Comic Strip for ${timestamp(new Date(garf.date), "D")}`,
|
||||
image: {
|
||||
url: garf.comic
|
||||
}
|
||||
}))
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue