Ejemplo n.º 1
0
def now_i(self, _, cmd):
    speakers = __tts_selector(self.cfg)
    prov = self.cfg.gts('providertts')
    if speakers is None:
        return Say(F('Не поддерживается для {}', prov))

    if cmd:
        cmd = cmd.lower()
        if prov == 'yandex':
            for key, val in YANDEX_EMOTION.items():
                if cmd == val.lower():
                    return __now_i_set_emo(self, key)
        for key, val in speakers.items():
            if cmd == val.lower():
                return __now_i_set_speaker(self, key, self.cfg[prov], speakers,
                                           prov == 'yandex')
    return Next
Ejemplo n.º 2
0
def now_i(self, _, cmd):
    speakers = __tts_selector(self.cfg)
    prov = self.cfg.gts('providertts')
    if speakers is None:
        return Say(LNG['who_now_no_support'].format(prov))

    if cmd:
        if prov == 'yandex':
            for key, val in YANDEX_EMOTION.items():
                if cmd == val:
                    return __now_i_set_emo(self, key)
        cmd = cmd[0].upper() + cmd[1:]
        for key, val in speakers.items():
            if cmd == val:
                return __now_i_set_speaker(self, key, self.cfg[prov], speakers,
                                           prov == 'yandex')
    return Next