Archived
0
0
Fork 0

feat: added owo language cuz i can :)

This commit is contained in:
Daryl Ronningen 2021-06-29 22:09:42 -05:00
parent a96b36e1d7
commit fe0d9ef75f
Signed by: Daryl Ronningen
GPG key ID: FD23F0C934A5EC6B
4 changed files with 46 additions and 5 deletions

View file

@ -16,10 +16,11 @@
*/
import Command from '@structures/command';
import config from 'config';
import { MessageButton } from 'discord.js';
import { Client, Message, MessageEmbed } from 'discord.js';
import { Client, Message, MessageButton, MessageEmbed } from 'discord.js';
import i18next from 'i18next';
// TODO: Redo this mf
export default class extends Command {
public constructor(client: Client, file: string) {
super(client, file, {
@ -58,7 +59,7 @@ export default class extends Command {
val.embed.setAuthor(i18next.t('commands:help.embedName'));
val.embed.setTitle(val.name.toUpperCase());
val.embed.setColor(message.member?.roles.highest.color ?? 0xFFFFFF);
val.embed.setFooter(`Page ${index+1}/${commandGroups.length}`);
val.embed.setFooter(`Page ${index + 1}/${commandGroups.length}`);
val.embed.setTimestamp();
val.commands.forEach((command) => {
@ -91,7 +92,7 @@ export default class extends Command {
if(interaction.customID === 'nextCategoryBtn') {
currentPage++;
if(currentPage+1 === commandGroups.length) {
if(currentPage + 1 === commandGroups.length) {
nextCategoryBtn.setDisabled(true);
}

View file

@ -87,6 +87,8 @@ client.on('message', async (msg) => {
msg.channel.startTyping();
await i18next.changeLanguage('owo');
if(findCommand.options.ownerOnly && msg.author.id !== config.get('owner')) {
await msg.reply(i18next.t('commands:errors.ownerOnly'));
return;
@ -112,6 +114,8 @@ client.on('message', async (msg) => {
await msg.reply(i18next.t('commands:errors.runError', { error: e.message }));
msg.channel.stopTyping();
}
await i18next.changeLanguage('en-US');
});
client.on('ready', async () => {
@ -123,7 +127,7 @@ client.on('ready', async () => {
defaultNS: 'common',
fallbackNS: 'common',
fallbackLng: 'en-US',
supportedLngs: ['en-US'],
supportedLngs: ['en-US', 'owo'],
backend: {
backends: [FSBackend],
backendOptions: [

View file

@ -0,0 +1,35 @@
{
"vm": {
"shortDescription": "Wuns code in a safe sandbox fow testing",
"extendedDescription": "Wuns code in a secuwe and safe sandbox fow pwototyping & testing code whiwe pweventing access to the system",
"languageArg": "The wanguage to use (JavaScript/TypeScript)",
"codeArg": "The code to wun in the VM",
"computing": "Computing { $language } code... Pwease wait owo",
"error": "An ewwow has occuwwed whiwe executing { $language } code!\n```\n{ $error }\n```",
"unknown": "Unknyown wanguage given owo"
},
"help": {
"shortDescription": "Shows hewp menyu",
"extendedDescription": "Shows an advanced hewp menyu fow commands to show usage",
"commandArg": "The command to see",
"unknownCommand": "Unknyown command given (・`ω´・)",
"embedName": "Hewp Menyu (・`ω´・)",
"helpScreenBtnHelp": "Pwess the \"Fowwawd\" ow \"Back\" Button to muv categowies owo ",
"nextCategoryBtn": "Nyext Categowy",
"previousCategoryBtn": "Pwevious Categowy",
"helpTimedOut": "Timed Out",
"commandDescription": "Nyame: { $name }\nCategowy: { $category }\nDescwiption: { $description }\nUsage: { $usage }"
},
"errors": {
"ownerOnly": "Onwy the bot ownyew can wun this command ^w^",
"dmsOnly": "You can onwy wun this command in DMs owo",
"serverOnly": "You can onwy wun this command in a sewvew owo",
"runError": "I'm sowwy but an ewwow has occuwwed whiwe wunnying this command ;;w;; Pwease fiwe an issue to https://code.relms.dev/Relms/ArgonBot!\n```{ $error }```"
},
"generic": {
"noShortDescription": "Nyo showt descwiption given >w<",
"noExtendedDescription": "Nyo extended descwiption given ^w^",
"noArgsDescription": "Nyo descwiption fow { $arg } has been given UwU",
"noUsage": "Nyo usage given ;;w;;"
}
}

View file

@ -0,0 +1 @@
{}