mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 06:03:04 -04:00
funny cat
This commit is contained in:
parent
a7a3b90b51
commit
2b96a3d231
3 changed files with 43 additions and 0 deletions
38
commands/message/fun/garfield.js
Normal file
38
commands/message/fun/garfield.js
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
|
||||||
|
const { garfield } = require('../../../labscore/api');
|
||||||
|
const { createEmbed } = require('../../../labscore/utils/embed');
|
||||||
|
const { timestamp } = require('../../../labscore/utils/markdown');
|
||||||
|
const { editOrReply } = require('../../../labscore/utils/message')
|
||||||
|
|
||||||
|
const { Permissions } = require("detritus-client/lib/constants");
|
||||||
|
|
||||||
|
const FUNNY_CAT_EMOJI = [
|
||||||
|
"<:gm:878401411556196352>",
|
||||||
|
"<:gn:878401411392606258>",
|
||||||
|
"<:funnycat:899419360748261396>"
|
||||||
|
]
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: 'garfield',
|
||||||
|
aliases: ['garf'],
|
||||||
|
metadata: {
|
||||||
|
description: 'Returns a random garfield comic strip.',
|
||||||
|
description_short: 'Random garfield comic',
|
||||||
|
examples: ['garf'],
|
||||||
|
category: 'fun',
|
||||||
|
usage: `garfield`
|
||||||
|
},
|
||||||
|
permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.USE_EXTERNAL_EMOJIS],
|
||||||
|
run: async (context) => {
|
||||||
|
context.triggerTyping();
|
||||||
|
|
||||||
|
const garf = (await garfield()).response.body
|
||||||
|
|
||||||
|
return editOrReply(context, createEmbed("default", context, {
|
||||||
|
description: `${FUNNY_CAT_EMOJI[Math.floor(Math.random() * FUNNY_CAT_EMOJI.length)]} Garfield Comic Strip for ${timestamp(new Date(garf.date), "D")}`,
|
||||||
|
image: {
|
||||||
|
url: garf.comic
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
};
|
|
@ -51,6 +51,7 @@ const Api = Object.freeze({
|
||||||
TTS_TIKTOK: '/tts/tiktok',
|
TTS_TIKTOK: '/tts/tiktok',
|
||||||
|
|
||||||
UTILS_EMOJIPEDIA: '/utils/emojipedia',
|
UTILS_EMOJIPEDIA: '/utils/emojipedia',
|
||||||
|
UTILS_GARFIELD: '/utils/garfield',
|
||||||
UTILS_INFERKIT: '/utils/inferkit',
|
UTILS_INFERKIT: '/utils/inferkit',
|
||||||
UTILS_MAPKIT: '/utils/mapkit',
|
UTILS_MAPKIT: '/utils/mapkit',
|
||||||
UTILS_PERSPECTIVE: '/utils/perspective',
|
UTILS_PERSPECTIVE: '/utils/perspective',
|
||||||
|
|
|
@ -296,6 +296,10 @@ module.exports.emojipedia = async function(context, emoji){
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports.garfield = async function(context, emoji){
|
||||||
|
return await request(Api.UTILS_GARFIELD, "GET", {}, {})
|
||||||
|
}
|
||||||
|
|
||||||
module.exports.inferkit = async function(context, input){
|
module.exports.inferkit = async function(context, input){
|
||||||
return await request(Api.UTILS_INFERKIT, "GET", {}, {
|
return await request(Api.UTILS_INFERKIT, "GET", {}, {
|
||||||
input: input
|
input: input
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue