diff --git a/src/commands/fun/happy.ts b/src/commands/fun/happy.ts new file mode 100644 index 0000000..d326b27 --- /dev/null +++ b/src/commands/fun/happy.ts @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +/* + Animal Rights Advocates Discord Bot + Copyright (C) 2022 Anthony Berg + + 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 { MessageEmbed } from 'discord.js'; +import { Happy } from '../../utils/gifs'; + +export class HappyCommand extends Command { + public constructor(context: Command.Context, options: Command.Options) { + super(context, { + ...options, + name: 'happy', + description: 'Express your happiness', + preconditions: ['PatreonOnly'], + }); + } + + // 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.ChatInputInteraction) { + // Get the user + // TODO exception handling + const member = interaction.member!.user; + const memberGuildMember = interaction.guild!.members.cache.get(member.id)!; + + // Creates the embed for the happy reaction + const randomHappy = Happy[Math.floor(Math.random() * Happy.length)]; + const happyEmbed = new MessageEmbed() + .setColor('#40ff00') + .setTitle(`Poke from ${memberGuildMember.displayName}`) + .setImage(randomHappy); + + // Send the embed + await interaction.reply({ embeds: [happyEmbed], fetchReply: true }); + } +} diff --git a/src/commands/fun/sad.ts b/src/commands/fun/sad.ts new file mode 100644 index 0000000..619285f --- /dev/null +++ b/src/commands/fun/sad.ts @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +/* + Animal Rights Advocates Discord Bot + Copyright (C) 2022 Anthony Berg + + 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 { MessageEmbed } from 'discord.js'; +import { Sad } from '../../utils/gifs'; + +export class SadCommand extends Command { + public constructor(context: Command.Context, options: Command.Options) { + super(context, { + ...options, + name: 'sad', + description: 'Express your sadness', + preconditions: ['PatreonOnly'], + }); + } + + // 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.ChatInputInteraction) { + // Get the user + // TODO exception handling + const member = interaction.member!.user; + const memberGuildMember = interaction.guild!.members.cache.get(member.id)!; + + // Creates the embed for the sad reaction + const randomSad = Sad[Math.floor(Math.random() * Sad.length)]; + const sadEmbed = new MessageEmbed() + .setColor('#001148') + .setTitle(`Poke from ${memberGuildMember.displayName}`) + .setImage(randomSad); + + // Send the embed + await interaction.reply({ embeds: [sadEmbed], fetchReply: true }); + } +} diff --git a/src/utils/gifs.ts b/src/utils/gifs.ts index 4ff33da..c019497 100644 --- a/src/utils/gifs.ts +++ b/src/utils/gifs.ts @@ -38,3 +38,21 @@ export const Poke = [ 'https://c.tenor.com/XAXSLU_w_yoAAAAd/boop-crow.gif', 'https://c.tenor.com/o9X9XXVCm-MAAAAC/bird-cute.gif', // Thanks to Jonquil (277429709711605761) <3 ]; + +// Thanks Dantas (605924328004911133) for the gifs <3 +export const Happy = [ + 'https://c.tenor.com/_4xCiEhhoZsAAAAd/dog-smile.gif', + 'https://c.tenor.com/GEP7e6U2uqgAAAAC/spongebob-happy.gif', + 'https://c.tenor.com/tNhtH9x3WZEAAAAC/swing-dance-swing-your-hips.gif', + 'https://c.tenor.com/C_Dl5-KCvVoAAAAC/friends-matthew-perry.gif', + 'https://c.tenor.com/aKFaZBrZFYcAAAAC/excited-spin.gif', +]; + +// Thanks Dantas (605924328004911133) for the gifs <3 +export const Sad = [ + 'https://c.tenor.com/6CujUsC1CIkAAAAd/crying-black-guy-meme50fps-interpolated-interpolated.gif', + 'https://c.tenor.com/RJnvTxShQGIAAAAC/disney-plus-disney.gif', + 'https://c.tenor.com/_XLEzC52ATQAAAAC/sad-walk.gif', + 'https://c.tenor.com/rD4KDir7lO0AAAAC/sad-pikachu.gif', + 'https://c.tenor.com/IeiDwBPDrZYAAAAC/peach-cat.gif', +];