weidengeist / Willowbot

A chat bot intended to be used on Twitch
GNU General Public License v3.0
4 stars 0 forks source link

No Cyrillic support #6

Closed LeoAlt8 closed 1 year ago

LeoAlt8 commented 1 year ago

Hello! Tell me please. Does the bot understand Cyrillic commands? The bot does not answer them:

`commands = {

"здрасти" : { "answer" : "Добре дошли! Радвам се да те видя!", "cooldown" : 60, "minLevel" : 1 },

"!шеф" : { "answer" : "Чат шеф! Цялото внимание!!! LUL LUL LUL ", "cooldown" : 30, "minLevel" : 3 }, }`

Is this too difficult to fix? 😭

weidengeist commented 1 year ago

I haven’t tested it thoroughly, but my guess is that the bot does not recognize the Cyrillic commands due to the cyrillicToLatin() function. This function has been added to identify spam bots that use Latin-looking Cyrillic glyphs to evade pattern matching for spam protection. You can deactivate this function by changing line 314 in the message.py module to self.text = self.getText().

LeoAlt8 commented 1 year ago

It seems to have helped. But it works strange - it doesn't always react. But I'll keep checking. I will write later.

LeoAlt8 commented 1 year ago

Works. The truth does not always answer the first time. I do not know why. This is not the case with Latin. Thanks for the help!

P.S. Do you have an account on a buymeacoffee or something like that?

weidengeist commented 1 year ago

I will take a closer look into it when I find the time to do so. Python supports UTF-8 out of the box, so it shouldn’t be a problem.

Not at the moment, but maybe I’ll add a donation link to the project page some time in the future. Thank you for your kind offer.