-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix command names, and add 8ball and owoify commands
- Loading branch information
1 parent
a16611a
commit 4cb42e1
Showing
11 changed files
with
108 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
}); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
}); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters