mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-17 02:17:05 -04:00
add message translations feature to ctx
This commit is contained in:
parent
f71aa434b0
commit
3b34dfcdd4
4 changed files with 127 additions and 28 deletions
|
@ -11,6 +11,7 @@ const Api = Object.freeze({
|
|||
GOOGLE_SPEECH_RECOGNIZE: '/google/speech/recognize',
|
||||
GOOGLE_SPEECH_RECOGNIZE_LABELS: '/google/speech/multirecognize',
|
||||
GOOGLE_TRANSLATE: '/google/translate/text',
|
||||
GOOGLE_TRANSLATE_MULTI: '/google/translate/multi',
|
||||
GOOGLE_VISION_COLORS: '/google/vision/colors',
|
||||
GOOGLE_VISION_FACES: '/google/vision/faces',
|
||||
GOOGLE_VISION_LABELS: '/google/vision/labels',
|
||||
|
|
|
@ -68,6 +68,14 @@ module.exports.googleTranslate = async function(context, text, to, from){
|
|||
})
|
||||
}
|
||||
|
||||
module.exports.googleTranslateMulti = async function(context, messages, to, from){
|
||||
return await request(Api.GOOGLE_TRANSLATE_MULTI, "POST", {}, {
|
||||
messages: messages,
|
||||
to: to,
|
||||
from: from
|
||||
})
|
||||
}
|
||||
|
||||
module.exports.googleVisionColors = async function(context, url){
|
||||
return await request(Api.GOOGLE_VISION_COLORS, "GET", {}, {
|
||||
url: url
|
||||
|
|
|
@ -79,6 +79,7 @@ module.exports.ICONS = Object.freeze({
|
|||
|
||||
"flask_mini": "<:ico_subt_flask:1263593669215256597>",
|
||||
"subtext_lightbulb": "<:ico_subt_lightbulb:1263593690358616084>",
|
||||
"subtext_translate": "<:ico_subtext_translate:1323844562875187291>",
|
||||
|
||||
"button_mag": "<:ico_button_mag:1271212564122173552>",
|
||||
"button_thermometer": "<:ico_button_thermometer:1263593823016062987>",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue