diff --git a/docs/commands/GENERAL.md b/docs/commands/GENERAL.md index b5a4ad9..eb1a1cc 100644 --- a/docs/commands/GENERAL.md +++ b/docs/commands/GENERAL.md @@ -29,3 +29,4 @@ a user, it will display that user's rank instead. - `/poke` - `/sad` - `/shrug` +- `/cringe` \ No newline at end of file diff --git a/src/commands/fun/cringe.ts b/src/commands/fun/cringe.ts new file mode 100644 index 0000000..aae26dc --- /dev/null +++ b/src/commands/fun/cringe.ts @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +/* + Animal Rights Advocates Discord Bot + Copyright (C) 2023 Anthony Berg, Stefanie Merceron + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +import { Command, RegisterBehavior } from '@sapphire/framework'; +import { EmbedBuilder } from 'discord.js'; +import { Cringe } from '#utils/gifs'; +import { addFunLog, countTotal } from '#utils/database/fun'; + +export class CringeCommand extends Command { + public constructor(context: Command.Context, options: Command.Options) { + super(context, { + ...options, + name: 'cringe', + description: 'Express your cringe', + }); + } + + // Registers that this is a slash command + public override registerApplicationCommands(registry: Command.Registry) { + registry.registerChatInputCommand( + (builder) => builder.setName(this.name).setDescription(this.description), + { + behaviorWhenNotIdentical: RegisterBehavior.Overwrite, + } + ); + } + + // Command run + public async chatInputRun(interaction: Command.ChatInputCommandInteraction) { + // Get the user + // TODO exception handling + const { user } = interaction; + + await addFunLog(user.id, 'cringe'); + const count = await countTotal(user.id, 'cringe'); + + // Creates the embed for the cringe reaction + const randomCringe = Cringe[Math.floor(Math.random() * Cringe.length)]; + const cringeEmbed = new EmbedBuilder() + .setColor('#001148') + .setTitle(`${user.username} feels immense cringe...`) + .setImage(randomCringe) + .setFooter({ text: `${user.username}'s cringe count: ${count}` }); + + // Send the embed + await interaction.reply({ embeds: [cringeEmbed], fetchReply: true }); + } +} diff --git a/src/utils/gifs.ts b/src/utils/gifs.ts index ca8c7a5..0694bb4 100644 --- a/src/utils/gifs.ts +++ b/src/utils/gifs.ts @@ -9,7 +9,7 @@ export const Hugs = [ 'https://c.tenor.com/16n9S22q870AAAAC/cute-boy.gif', 'https://c.tenor.com/cdk8SjH32okAAAAC/dog-pig.gif', 'https://c.tenor.com/9mLPT5v1ah8AAAAd/how-to-introduce-your-cat-to-a-bunny-cat.gif', - 'https://media.tenor.com/QnzyFMrXfr0AAAAC/bear-bruh.gif', // Thanks to Jonquil (277429709711605761) <3 + 'https://c.tenor.com/QnzyFMrXfr0AAAAC/bear-bruh.gif', // Thanks to Jonquil (277429709711605761) <3 ]; export const Kill = [ @@ -18,7 +18,7 @@ export const Kill = [ 'https://c.tenor.com/OzKRQVQWOxgAAAAC/penguin-push.gif', 'https://c.tenor.com/P3ISPtq4tyMAAAAC/horse-animals.gif', 'https://c.tenor.com/6BtYZBaOTjsAAAAC/kangaroos-fun.gif', - 'https://media.tenor.com/ntRZRkjP_2MAAAAC/kitten-cat.gif', + 'https://c.tenor.com/ntRZRkjP_2MAAAAC/kitten-cat.gif', 'https://c.tenor.com/8TfmfQv5lqgAAAAC/doggo-killing-cat.gif', 'https://c.tenor.com/N1eC5_O9KiAAAAAd/justketh-goose-attack.gif', 'https://c.tenor.com/lSGhAaUU2iQAAAAC/honk-honk-am-goose-cute.gif', @@ -68,3 +68,16 @@ export const N1984 = [ 'https://c.tenor.com/dcxOO-080OcAAAAd/discord-moderators.gif', 'https://c.tenor.com/-cUS-fPIEBsAAAAd/5second-slow-mode-1984.gif', ]; + +export const Cringe = [ + 'https://c.tenor.com/bgR1joaDW6AAAAAd/modcheck-discord.gif', + 'https://c.tenor.com/cF6QU65nSpoAAAAd/cringe.gif', + 'https://c.tenor.com/6COELe56B8IAAAAC/confused-turn-around.gif', + 'https://c.tenor.com/tEEjB0RnxyAAAAAC/puppet-awkward.gif', + 'https://c.tenor.com/VNlo9wZpYvsAAAAd/bruh.gif', + 'https://c.tenor.com/BuS697n_PjMAAAAC/squidward-squidward-tentacles.gif', + 'https://c.tenor.com/_BiwWBWhYucAAAAd/what-huh.gif', + 'https://c.tenor.com/Zm4UTU5fw2UAAAAd/bruh.gif', + 'https://c.tenor.com/d7Xd91nKnDUAAAAC/my-eyes-ugly.gif', + 'https://c.tenor.com/bzpFHIbvpJMAAAAd/cat-bruh.gif', +]; diff --git a/tsconfig.json b/tsconfig.json index 4525233..b5a1dec 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -104,4 +104,4 @@ // "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, "include": ["src"] -} +} \ No newline at end of file