Browse Source

chore: add fetch_translate method to Bridge class

master
lanvent 1 year ago
parent
commit
9a99caeb9d
2 changed files with 4 additions and 1 deletions
  1. +0
    -0
      bot/bot_factory.py
  2. +4
    -1
      bridge/bridge.py

bot/factory.py → bot/bot_factory.py View File


+ 4
- 1
bridge/bridge.py View File

@@ -1,4 +1,4 @@
from bot.factory import create_bot
from bot.bot_factory import create_bot
from bridge.context import Context from bridge.context import Context
from bridge.reply import Reply from bridge.reply import Reply
from common import const from common import const
@@ -49,3 +49,6 @@ class Bridge(object):


def fetch_text_to_voice(self, text) -> Reply: def fetch_text_to_voice(self, text) -> Reply:
return self.get_bot("text_to_voice").textToVoice(text) return self.get_bot("text_to_voice").textToVoice(text)

def fetch_translate(self, text, from_lang="", to_lang="en") -> Reply:
return self.get_bot("translate").translate(text, from_lang, to_lang)

Loading…
Cancel
Save