diff --git a/src/commands/fun/love.ts b/src/commands/fun/love.ts index 4c0c037..6e2236b 100644 --- a/src/commands/fun/love.ts +++ b/src/commands/fun/love.ts @@ -1,5 +1,13 @@ +import {SlashCommandBuilder} from "@discordjs/builders"; +import {CommandInteraction} from "discord.js"; import {NamedCommand, CHANNEL_TYPE} from "onion-lasers"; +export const header = new SlashCommandBuilder().setDescription("Chooses someone to love."); +export async function handler(interaction: CommandInteraction) { + const member = interaction.guild!.members.cache.random(); + if (!member) return interaction.reply("For some reason, an error occurred fetching a member."); + return interaction.reply(`I love ${member.nickname ?? member.user.username}!`); +} export default new NamedCommand({ description: "Chooses someone to love.", channelType: CHANNEL_TYPE.GUILD, diff --git a/src/commands/fun/ok.ts b/src/commands/fun/ok.ts index 73c368b..11e7a81 100644 --- a/src/commands/fun/ok.ts +++ b/src/commands/fun/ok.ts @@ -1,3 +1,5 @@ +import {SlashCommandBuilder} from "@discordjs/builders"; +import {CommandInteraction} from "discord.js"; import {NamedCommand} from "onion-lasers"; import {random} from "../../lib"; @@ -58,7 +60,10 @@ const responses = [ "cat", "large man" ]; - +export const header = new SlashCommandBuilder().setDescription("Sends random ok message."); +export async function handler(interaction: CommandInteraction) { + interaction.reply(`ok ${random(responses)}`); +} export default new NamedCommand({ description: "Sends random ok message.", async run({send}) { diff --git a/src/commands/fun/owoify.ts b/src/commands/fun/owoify.ts index 1d4882c..915f1ed 100644 --- a/src/commands/fun/owoify.ts +++ b/src/commands/fun/owoify.ts @@ -1,6 +1,25 @@ import {NamedCommand, RestCommand} from "onion-lasers"; import {random} from "../../lib"; +import {SlashCommandBuilder} from "@discordjs/builders"; +import {CommandInteraction} from "discord.js"; +export const header = new SlashCommandBuilder() + .setDescription("OwO-ifies the input.") + .addStringOption((option) => option.setName("text").setDescription("Text to owoify").setRequired(true)); + +export async function handler(interaction: CommandInteraction) { + const {options} = interaction; + const faces = ["owo", "UwU", ">w<", "^w^"]; + const owoified = options + .getString("text", true) + .replace(/[rl]/g, "w") + .replace(/[RL]/g, "W") + .replace(/ove/g, "uv") + .replace(/n/g, "ny") + .replace(/N/g, "NY") + .replace(/\!/g, ` ${random(faces)} `); + interaction.reply(owoified); +} export default new NamedCommand({ description: "OwO-ifies the input.", run: "You need to specify some text to owoify.", diff --git a/src/commands/fun/pat.ts b/src/commands/fun/pat.ts index a1e91fb..5ddf6f7 100644 --- a/src/commands/fun/pat.ts +++ b/src/commands/fun/pat.ts @@ -1,6 +1,23 @@ import {MessageAttachment, User} from "discord.js"; import {NamedCommand, Command, RestCommand, getUserByNickname} from "onion-lasers"; import petPetGif from "pet-pet-gif"; +import {SlashCommandBuilder} from "@discordjs/builders"; +import {CommandInteraction} from "discord.js"; + +//Ravioli ravioli... +//number from 1 to 9 +export const header = new SlashCommandBuilder() + .setDescription("Generates a pat GIF of the avatar of the mentioned user.") + .addUserOption((option) => option.setName("user").setDescription("User you want a pat gif of.").setRequired(true)); + +export async function handler(interaction: CommandInteraction) { + await interaction.reply("Generating pat gif..."); + const {options} = interaction; + const pfp = options.getUser("user", true).displayAvatarURL({format: "png"}); + const gif = await petPetGif(pfp); + const file = new MessageAttachment(gif, "pat.gif"); + await interaction.editReply({content: "Here you go!", files: [file]}); +} export default new NamedCommand({ description: "Generates a pat GIF of the provided attachment image OR the avatar of the mentioned user.",