Compare commits

..

No commits in common. "dec7d3a50a4c997a28fb9bad1a262aed28d7c864" and "fd9cc4783609b73d87593bdd3f1a98c2c5099a2a" have entirely different histories.

3 changed files with 4 additions and 53 deletions

3
.gitignore vendored
View File

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

View File

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

View File

@ -15,7 +15,7 @@ commands.push({
{ {
type: "STRING", type: "STRING",
name: "text", name: "text",
description: "Text to translate", description: "Text",
required: true required: true
} }
], ],
@ -29,60 +29,12 @@ commands.push({
{ {
type: "STRING", type: "STRING",
name: "text", name: "text",
description: "Text to translate", description: "Text",
required: true required: true
} }
], ],
exec: i => t(i, "JA") 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) { async function t(i, target_lang) {
var text = i.options.getString("text"); var text = i.options.getString("text");