feat: added owo language cuz i can :)
This commit is contained in:
parent
a96b36e1d7
commit
fe0d9ef75f
4 changed files with 46 additions and 5 deletions
|
@ -16,10 +16,11 @@
|
||||||
*/
|
*/
|
||||||
import Command from '@structures/command';
|
import Command from '@structures/command';
|
||||||
import config from 'config';
|
import config from 'config';
|
||||||
import { MessageButton } from 'discord.js';
|
import { Client, Message, MessageButton, MessageEmbed } from 'discord.js';
|
||||||
import { Client, Message, MessageEmbed } from 'discord.js';
|
|
||||||
import i18next from 'i18next';
|
import i18next from 'i18next';
|
||||||
|
|
||||||
|
// TODO: Redo this mf
|
||||||
|
|
||||||
export default class extends Command {
|
export default class extends Command {
|
||||||
public constructor(client: Client, file: string) {
|
public constructor(client: Client, file: string) {
|
||||||
super(client, file, {
|
super(client, file, {
|
||||||
|
@ -58,7 +59,7 @@ export default class extends Command {
|
||||||
val.embed.setAuthor(i18next.t('commands:help.embedName'));
|
val.embed.setAuthor(i18next.t('commands:help.embedName'));
|
||||||
val.embed.setTitle(val.name.toUpperCase());
|
val.embed.setTitle(val.name.toUpperCase());
|
||||||
val.embed.setColor(message.member?.roles.highest.color ?? 0xFFFFFF);
|
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.embed.setTimestamp();
|
||||||
|
|
||||||
val.commands.forEach((command) => {
|
val.commands.forEach((command) => {
|
||||||
|
@ -91,7 +92,7 @@ export default class extends Command {
|
||||||
if(interaction.customID === 'nextCategoryBtn') {
|
if(interaction.customID === 'nextCategoryBtn') {
|
||||||
currentPage++;
|
currentPage++;
|
||||||
|
|
||||||
if(currentPage+1 === commandGroups.length) {
|
if(currentPage + 1 === commandGroups.length) {
|
||||||
nextCategoryBtn.setDisabled(true);
|
nextCategoryBtn.setDisabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,8 @@ client.on('message', async (msg) => {
|
||||||
|
|
||||||
msg.channel.startTyping();
|
msg.channel.startTyping();
|
||||||
|
|
||||||
|
await i18next.changeLanguage('owo');
|
||||||
|
|
||||||
if(findCommand.options.ownerOnly && msg.author.id !== config.get('owner')) {
|
if(findCommand.options.ownerOnly && msg.author.id !== config.get('owner')) {
|
||||||
await msg.reply(i18next.t('commands:errors.ownerOnly'));
|
await msg.reply(i18next.t('commands:errors.ownerOnly'));
|
||||||
return;
|
return;
|
||||||
|
@ -112,6 +114,8 @@ client.on('message', async (msg) => {
|
||||||
await msg.reply(i18next.t('commands:errors.runError', { error: e.message }));
|
await msg.reply(i18next.t('commands:errors.runError', { error: e.message }));
|
||||||
msg.channel.stopTyping();
|
msg.channel.stopTyping();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await i18next.changeLanguage('en-US');
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on('ready', async () => {
|
client.on('ready', async () => {
|
||||||
|
@ -123,7 +127,7 @@ client.on('ready', async () => {
|
||||||
defaultNS: 'common',
|
defaultNS: 'common',
|
||||||
fallbackNS: 'common',
|
fallbackNS: 'common',
|
||||||
fallbackLng: 'en-US',
|
fallbackLng: 'en-US',
|
||||||
supportedLngs: ['en-US'],
|
supportedLngs: ['en-US', 'owo'],
|
||||||
backend: {
|
backend: {
|
||||||
backends: [FSBackend],
|
backends: [FSBackend],
|
||||||
backendOptions: [
|
backendOptions: [
|
||||||
|
|
35
translations/owo/commands.json
Normal file
35
translations/owo/commands.json
Normal 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;;"
|
||||||
|
}
|
||||||
|
}
|
1
translations/owo/common.json
Normal file
1
translations/owo/common.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{}
|
Reference in a new issue