mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 14:43:05 -04:00
fix error on unknown language flag
This commit is contained in:
parent
b837460b33
commit
c2ec17e1d7
2 changed files with 4 additions and 1 deletions
|
@ -39,6 +39,9 @@ module.exports = {
|
|||
|
||||
args.to = getCodeFromAny(args.to)
|
||||
args.from = getCodeFromAny(args.from)
|
||||
|
||||
if(!args.to) return editOrReply(context, createEmbed("warning", context, "Invalid language (to)."))
|
||||
if(!args.from) return editOrReply(context, createEmbed("warning", context, "Invalid language (from)."))
|
||||
|
||||
try{
|
||||
let translate = await googleTranslate(context, content, args.to, args.from)
|
||||
|
|
|
@ -16,7 +16,7 @@ function getCode(desiredLang) {
|
|||
}
|
||||
|
||||
return TRANSLATE_LANGUAGES[key].toLowerCase() === desiredLang;
|
||||
});
|
||||
});
|
||||
|
||||
keys.push(Object.keys(TRANSLATE_LANGUAGE_MAPPINGS).filter(function (key) {
|
||||
if (typeof TRANSLATE_LANGUAGE_MAPPINGS[key] !== 'string') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue