Compare commits

...

2 Commits

Author SHA1 Message Date
dec7d3a50a add /to 2021-12-31 21:25:51 -08:00
978e08b713 bruh
also update .gitignore
%%
2021-12-23 10:40:25 -08:00
3 changed files with 53 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
node_modules
secrets.env
data
tokens.txt

View File

@ -40,7 +40,7 @@ module.exports = class DiscordBackup {
}
}
async serialize() {
serialize() {
return JSON.stringify(this.data);
}

View File

@ -15,7 +15,7 @@ commands.push({
{
type: "STRING",
name: "text",
description: "Text",
description: "Text to translate",
required: true
}
],
@ -29,12 +29,60 @@ commands.push({
{
type: "STRING",
name: "text",
description: "Text",
description: "Text to translate",
required: true
}
],
exec: i => t(i, "JA")
});
commands.push({
name: "to",
description: "Translate text to any language",
global: true,
options: [
{
type: "STRING",
name: "lang",
description: "Language to translate to",
required: true,
options: [
{ name: 'Bulgarian', value: 'BG' },
{ name: 'Czech', value: 'CS' },
{ name: 'Danish', value: 'DA' },
{ name: 'German', value: 'DE' },
{ name: 'Greek', value: 'EL' },
{ name: 'English (British)', value: 'EN-GB' },
{ name: 'English (American)', value: 'EN-US' },
{ name: 'Spanish', value: 'ES' },
{ name: 'Estonian', value: 'ET' },
{ name: 'Finnish', value: 'FI' },
{ name: 'French', value: 'FR' },
{ name: 'Hungarian', value: 'HU' },
{ name: 'Italian', value: 'IT' },
{ name: 'Japanese', value: 'JA' },
{ name: 'Lithuanian', value: 'LT' },
{ name: 'Latvian', value: 'LV' },
{ name: 'Dutch', value: 'NL' },
{ name: 'Polish', value: 'PL' },
{ name: 'Portuguese (all Portuguese varieties excluding Brazilian Portuguese)', value: 'PT-PT' },
{ name: 'Portuguese (Brazilian)', value: 'PT-BR' },
{ name: 'Romanian', value: 'RO' },
{ name: 'Russian', value: 'RU' },
{ name: 'Slovak', value: 'SK' },
{ name: 'Slovenian', value: 'SL' },
{ name: 'Swedish', value: 'SV' },
{ name: 'Chinese', value: 'ZH' }
]
},
{
type: "STRING",
name: "text",
description: "Text to translate",
required: true
}
],
exec: i => t(i, i.options.getString("lang"))
});
async function t(i, target_lang) {
var text = i.options.getString("text");