Closed ammarfaizi2 closed 3 years ago
Deploy a translator API and implement translate module for the bot. We will utilize a scraper to gather the data from Google Translate.
Translate command is any message that matches the following pattern:
/^(?:\/|\!|\~|\.)?(?:t[rl])\s(\S+)\s(\S+)\s(.+)$/Usi
$1
$2
$3
Available languages can be seen here: https://github.com/ammarfaizi2/GoogleTranslate/blob/master/README.md
Source language ($1) may contain auto. Which means it uses auto detect mechanism in the Google Translate API.
auto
/^(?:\/|\!|\~|\.)?(?:t[rl])(?:\s(\S+)\s(\S+))?$/Usi
en
tr en id good morning
selamat pagi
Good morning
tr en ja
おはようございます
The translate replied message cannot be performed without finishing this issue https://github.com/GNUWeeb/GNUWeebBot/issues/17
Deploy a translator API and implement translate module for the bot. We will utilize a scraper to gather the data from Google Translate.
Translate feature specification
Translate command is any message that matches the following pattern:
$1
is the code of source language.$2
is the code of target language.$3
is the text written in source language to be translated to target language.Available languages can be seen here: https://github.com/ammarfaizi2/GoogleTranslate/blob/master/README.md
Source language (
$1
) may containauto
. Which means it uses auto detect mechanism in the Google Translate API.Extra (translate replied message)
$1
is the code of source language.$2
is the code of target language.$1
and$2
may be omitted, when they're omitted, the default value for$1
isauto
and$2
isen
.Examples
tr en id good morning
, the bot must reply it withselamat pagi
.Good morning
, then User B replies to the message withtr en ja
, the bot must reply user A message's withおはようございます
.TODO List