comparison sat/plugins/plugin_exp_lang_detect.py @ 4051:c23cad65ae99

core: renamed `messageReceived` trigger to `message_received`
author Goffi <goffi@goffi.org>
date Mon, 29 May 2023 13:32:08 +0200
parents 524856bd7b19
children
comparison
equal deleted inserted replaced
4050:199473ffe4ea 4051:c23cad65ae99
64 class LangDetect(object): 64 class LangDetect(object):
65 def __init__(self, host): 65 def __init__(self, host):
66 log.info(_("Language detection plugin initialization")) 66 log.info(_("Language detection plugin initialization"))
67 self.host = host 67 self.host = host
68 host.memory.update_params(PARAMS) 68 host.memory.update_params(PARAMS)
69 host.trigger.add("messageReceived", self.message_received_trigger) 69 host.trigger.add("message_received", self.message_received_trigger)
70 host.trigger.add("sendMessage", self.message_send_trigger) 70 host.trigger.add("sendMessage", self.message_send_trigger)
71 71
72 def add_language(self, mess_data): 72 def add_language(self, mess_data):
73 message = mess_data["message"] 73 message = mess_data["message"]
74 if len(message) == 1 and list(message.keys())[0] == "": 74 if len(message) == 1 and list(message.keys())[0] == "":