Move the rest of fun commands to interactions

This commit is contained in:
smartfridge 2021-12-11 18:31:10 +01:00
parent 7482f193e2
commit 1106cf7a4d
4 changed files with 52 additions and 2 deletions

View File

@ -1,5 +1,7 @@
import {NamedCommand, RestCommand} from "onion-lasers";
import {random} from "../../lib";
import {SlashCommandBuilder} from "@discordjs/builders";
import {CommandInteraction} from "discord.js";
const responses = [
"Most likely,",
@ -23,7 +25,14 @@ const responses = [
"Outlook not so good,",
"Very doubtful,"
];
export const header = new SlashCommandBuilder()
.setDescription("Answers your question in an 8-ball manner.")
.addStringOption((option) =>
option.setName("question").setDescription("Question to ask the 8-ball.").setRequired(true)
);
export async function handler(interaction: CommandInteraction) {
interaction.reply(`${random(responses)} ${interaction.user.tag}`);
}
export default new NamedCommand({
description: "Answers your question in an 8-ball manner.",
usage: "<question>",

View File

@ -1,7 +1,8 @@
import {User} from "discord.js";
import {Command, NamedCommand} from "onion-lasers";
import {random, parseVars} from "../../lib";
import {SlashCommandBuilder} from "@discordjs/builders";
import {CommandInteraction} from "discord.js";
const cookies = [
`has given %target% a chocolate chip cookie!`,
`has given %target% a soft homemade oatmeal cookie!`,
@ -25,6 +26,20 @@ const cookies = [
`bakes %target% fresh cookies, it smells amazing.`
];
export const header = new SlashCommandBuilder()
.setDescription("Gives specified user a cookie.")
.addUserOption((option) =>
option.setName("user").setDescription("User you want to give a cookie to.").setRequired(true)
);
export async function handler(interaction: CommandInteraction) {
const {options} = interaction;
return interaction.reply(
`:cookie: ${interaction.user.tag} ${parseVars(random(cookies), {
target: options.getUser("user", true).tag.toString()
})}`
);
}
export default new NamedCommand({
description: "Gives specified user a cookie.",
usage: "['all'/@user]",

View File

@ -1,7 +1,24 @@
import {NamedCommand, RestCommand} from "onion-lasers";
import figlet from "figlet";
import {Util} from "discord.js";
import {SlashCommandBuilder} from "@discordjs/builders";
import {CommandInteraction} from "discord.js";
export const header = new SlashCommandBuilder()
.setDescription("Generates a figlet of your input.")
.addStringOption((option) =>
option.setName("text").setDescription("Text used to create the figlet.").setRequired(true)
);
export async function handler(interaction: CommandInteraction) {
const {options} = interaction;
return interaction.reply(
`\`\`\`\n${Util.cleanCodeBlockContent(
figlet.textSync(options.getString("text", true), {
horizontalLayout: "full"
})
)}\n\`\`\``
);
}
export default new NamedCommand({
description: "Generates a figlet of your input.",
run: "You have to provide input for me to create a figlet!",

View File

@ -1,5 +1,14 @@
import {NamedCommand} from "onion-lasers";
import {SlashCommandBuilder} from "@discordjs/builders";
import {CommandInteraction} from "discord.js";
export const header = new SlashCommandBuilder().setDescription("Insult TravBot >:D");
export async function handler(interaction: CommandInteraction) {
interaction.reply(
`@${interaction.user.tag} What the fuck did you just fucking say about me, you little bitch? I'll have you know I graduated top of my class in the Navy Seals, and I've been involved in numerous secret raids on Al-Quaeda, and I have over 300 confirmed kills. I am trained in gorilla warfare and I'm the top sniper in the entire US armed forces. You are nothing to me but just another target. I will wipe you the fuck out with precision the likes of which has never been seen before on this Earth, mark my fucking words. You think you can get away with saying that shit to me over the Internet? Think again, fucker. As we speak I am contacting my secret network of spies across the USA and your IP is being traced right now so you better prepare for the storm, maggot. The storm that wipes out the pathetic little thing you call your life. You're fucking dead, kid. I can be anywhere, anytime, and I can kill you in over seven hundred ways, and that's just with my bare hands. Not only am I extensively trained in unarmed combat, but I have access to the entire arsenal of the United States Marine Corps and I will use it to its full extent to wipe your miserable ass off the face of the continent, you little shit. If only you could have known what unholy retribution your little "clever" comment was about to bring down upon you, maybe you would have held your fucking tongue. But you couldn't, you didn't, and now you're paying the price, you goddamn idiot. I will shit fury all over you and you will drown in it. You're fucking dead, kiddo.`
);
}
export default new NamedCommand({
description: "Insult TravBot! >:D",
async run({send, channel, author}) {