Skip to content

Commit

Permalink
Fix command names, and add 8ball and owoify commands
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDogHusky committed Sep 11, 2024
1 parent a16611a commit 4cb42e1
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 12 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dotenv": "^16.4.5",
"mongoose": "^8.6.1",
"ms": "^2.1.3",
"nekonya.js": "^1.1.8",
"nekonya.js": "^1.2.8",
"pterodactyl.js": "^2.1.1",
"tsx": "^4.19.0"
},
Expand Down
55 changes: 55 additions & 0 deletions src/commands/fun/8ball.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import Command from '../../struct/command';
import Client from '../../struct/client';
import { ChatInputCommandInteraction, ApplicationCommandOptionType, EmbedBuilder } from 'discord.js';
import { IGuild } from '../../struct/typings';
import * as NekoNya from 'nekonya.js';

export default class OwoifyCommand extends Command {
constructor(client: Client) {
super(client, {
name: '8ball',
description: 'Ask the magic 8ball a question!',
category: 'fun',
usage: '8ball <question> [cute]',
ownerOnly: false,
nsfw: false,
options: [{
name: 'question',
description: 'Your question',
type: ApplicationCommandOptionType.String,
required: true
}, {
name: 'cute',
description: 'Whether to make the answer cute',
type: ApplicationCommandOptionType.Boolean,
required: false
}],
defer: false
});
};

public async run(client: Client, ctx: ChatInputCommandInteraction<"cached">, data: IGuild): Promise<void> {
const text = ctx.options.getString('question', true).replaceAll("\\n", "\n");
const result = await NekoNya.eightball(ctx.options.getBoolean('cute', false) || false);

const embed = new EmbedBuilder()
.setColor(client.config.colors.main)
.setTimestamp()
.setTitle(`${client.config.emotes.hug}・8ball Answer`)
.addFields([
{
name: `${client.config.emotes.question}・Question`,
value: `> ${text}`
},
{
name: `${client.config.emotes.eightball}・Answer`,
value: `> ${result}`
}
])
.setAuthor({ name: ctx.user.tag, iconURL: ctx.user.displayAvatarURL({ size: 1024, extension: 'webp' }) })
.setFooter({ text: `Requested by ${ctx.user.tag}`, iconURL: client.user?.displayAvatarURL({ size: 1024, extension: 'webp' }) });
await ctx.reply({
embeds: [embed]
});
};
};
2 changes: 1 addition & 1 deletion src/commands/fun/hug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ChatInputCommandInteraction, ApplicationCommandOptionType, EmbedBuilder
import { IGuild } from '../../struct/typings';
import * as NekoNya from 'nekonya.js';

export default class KitsuneCommand extends Command {
export default class HugCommand extends Command {
constructor(client: Client) {
super(client, {
name: 'hug',
Expand Down
2 changes: 1 addition & 1 deletion src/commands/fun/kiss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ChatInputCommandInteraction, ApplicationCommandOptionType, EmbedBuilder
import { IGuild } from '../../struct/typings';
import * as NekoNya from 'nekonya.js';

export default class KitsuneCommand extends Command {
export default class KissCommand extends Command {
constructor(client: Client) {
super(client, {
name: 'kiss',
Expand Down
2 changes: 1 addition & 1 deletion src/commands/fun/kitsune.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as NekoNya from 'nekonya.js';
export default class KitsuneCommand extends Command {
constructor(client: Client) {
super(client, {
name: 'neko',
name: 'kitsune',
description: 'Get a random kitsune image',
category: 'fun',
usage: 'kitsune [number]',
Expand Down
2 changes: 1 addition & 1 deletion src/commands/fun/lewd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ChatInputCommandInteraction, ApplicationCommandOptionType, EmbedBuilder
import { IGuild } from '../../struct/typings';
import * as NekoNya from 'nekonya.js';

export default class NekoCommand extends Command {
export default class LewdCommand extends Command {
constructor(client: Client) {
super(client, {
name: 'lewd',
Expand Down
41 changes: 41 additions & 0 deletions src/commands/fun/owoify.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import Command from '../../struct/command';
import Client from '../../struct/client';
import { ChatInputCommandInteraction, ApplicationCommandOptionType, EmbedBuilder } from 'discord.js';
import { IGuild } from '../../struct/typings';
import * as NekoNya from 'nekonya.js';

export default class OwoifyCommand extends Command {
constructor(client: Client) {
super(client, {
name: 'owoify',
description: 'Make your text cute!',
category: 'fun',
usage: 'owoify <text>',
ownerOnly: false,
nsfw: false,
options: [{
name: 'text',
description: 'The text to owoify',
type: ApplicationCommandOptionType.String,
required: true
}],
defer: false
});
};

public async run(client: Client, ctx: ChatInputCommandInteraction<"cached">, data: IGuild): Promise<void> {
const text = ctx.options.getString('text', true).replaceAll("\\n", "\n");
const result = (await NekoNya.owoify(text)).replaceAll("\n", "\n> ");

const embed = new EmbedBuilder()
.setColor(client.config.colors.main)
.setTimestamp()
.setDescription(`> ${result}`)
.setTitle(`${client.config.emotes.hug}・Owoify Result`)
.setAuthor({ name: ctx.user.tag, iconURL: ctx.user.displayAvatarURL({ size: 1024, extension: 'webp' }) })
.setFooter({ text: `Requested by ${ctx.user.tag}`, iconURL: client.user?.displayAvatarURL({ size: 1024, extension: 'webp' }) });
await ctx.reply({
embeds: [embed]
});
};
};
2 changes: 1 addition & 1 deletion src/commands/fun/pat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ChatInputCommandInteraction, ApplicationCommandOptionType, EmbedBuilder
import { IGuild } from '../../struct/typings';
import * as NekoNya from 'nekonya.js';

export default class KitsuneCommand extends Command {
export default class PatCommand extends Command {
constructor(client: Client) {
super(client, {
name: 'pat',
Expand Down
2 changes: 1 addition & 1 deletion src/commands/fun/slap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ChatInputCommandInteraction, ApplicationCommandOptionType, EmbedBuilder
import { IGuild } from '../../struct/typings';
import * as NekoNya from 'nekonya.js';

export default class KitsuneCommand extends Command {
export default class SlapCommand extends Command {
constructor(client: Client) {
super(client, {
name: 'slap',
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */

/* Language and Environment */
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
Expand Down

0 comments on commit 4cb42e1

Please sign in to comment.