add хуех on эх, start command

This commit is contained in:
Er2 2022-02-25 10:31:32 +03:00
parent 7e26dfa38d
commit b0f616fd32
5 changed files with 18 additions and 2 deletions

View file

@ -12,6 +12,7 @@ return {
'command', 'command',
'ready', 'ready',
'inlineQuery', 'inlineQuery',
'message',
}, },
parts = { parts = {
'locale', 'locale',

View file

@ -1,6 +1,6 @@
return { return {
hide = true, hide = true,
run = function(C, msg) run = function(C, msg)
C.api:reply(msg, 'TODO!') C.api:reply(msg, msg.loc.msg)
end end
} }

9
src/events/message.lua Normal file
View file

@ -0,0 +1,9 @@
return function(C, api, msg)
-- надоели эхать
if msg.text
and msg.text:match '[Ээ]+[Хх]+' then
C.api:reply(msg, msg.text
:gsub('[Ээ]+[Хх]+', 'хуех')
,nil)
end
end

View file

@ -26,6 +26,9 @@
"cur": "Currency at %s:\n%s", "cur": "Currency at %s:\n%s",
"notf": "\nNot found: ", "notf": "\nNot found: ",
"prov": "\nData provided from central bank of Russia." "prov": "\nData provided from central bank of Russia."
},
"start": {
"msg": "Hi! I'm Computer - an open-source bot.\nIf you looking for source code: https://gitdab.com/er2/comp-tg"
} }
} }
} }

View file

@ -26,6 +26,9 @@
"cur": "Курс на %s:\n%s", "cur": "Курс на %s:\n%s",
"notf": "\nНе нашлось: ", "notf": "\nНе нашлось: ",
"prov": "\nДанные предоставлены центральным банком России." "prov": "\nДанные предоставлены центральным банком России."
},
"start": {
"msg": "Привет! Я Computer - бот с открытым исходным кодом.\nЕсли ты ищешь исходники: https://gitdab.com/er2/comp-tg"
} }
} }
} }