Commit Graph

281 Commits

Author SHA1 Message Date
eleksir
33616284ca Add PollAnswer object 2020-12-22 01:12:38 +03:00
eleksir
d8728b383e Chat.pm: add linked_chat_id and location fields 2020-12-22 00:46:32 +03:00
eleksir
59e8fa525a Add ChatLocation object 2020-12-22 00:45:39 +03:00
eleksir
afe50154ab Base.pm: perlcritic fixes 2020-12-21 23:59:08 +03:00
eleksir
252bb86eb8 Add fields sender_chat, dice and proximity_alert_triggered to Message.pm
+ Add fields sender_chat, dice and proximity_alert_triggered
* Re-arrange fields list in online-docs' order
* perlcritic fixes
2020-12-21 23:55:15 +03:00
eleksir
2b06abdbf4 Add object Dice 2020-12-21 23:54:03 +03:00
eleksir
083ae88386 Add object ProximityAlertTriggered 2020-12-21 23:53:24 +03:00
eleksir
3787bb3073 Implement !cat and !кис commands 2020-12-20 15:30:19 +03:00
eleksir
0cfecd72b3 Implement fuzzy matching in bred answer checking to avoid repeating input phrase. 2020-12-20 14:43:32 +03:00
eleksir
07275c5b43 Re-run Mojo::Loop everytime it dies, not just once. 2020-12-19 22:01:08 +03:00
eleksir
8bbe3b5d18 Make use of replyMd() in newcommer greet, add botsleep() utility sub 2020-12-19 17:34:20 +03:00
eleksir
10fc353924 Move !help to botlib.pm 2020-12-19 17:25:20 +03:00
eleksir
4a312e23d1 Add replyMd() to message object, implement canTalk() check in Teapot lib, re-arrange code 2020-12-19 17:15:01 +03:00
eleksir
cc43141d20 Implement !dig and !копать commands, fix typo in help message 2020-12-19 01:22:51 +03:00
eleksir
642aadfd84 Print chat mention to log only on debug "loglevel" 2020-12-17 11:59:11 +03:00
eleksir
0327130a5d Telegram api can give us unexpected data during outage, try not to die/hang 2020-12-17 11:54:43 +03:00
eleksir
e861f5420b Implement logging via Log::Any, cleanup, remove logger() 2020-12-13 16:23:16 +03:00
eleksir
a9193faf12 Do not answer in chat if quoted mention less than 4 chars. 2020-12-02 20:26:16 +03:00
eleksir
0256f6b45b Trim() phrase before putting it to karma 2020-12-01 19:47:13 +03:00
eleksir
1031fe9242 Enhance friday.txt file parser, add some quotes to friday.txt 2020-11-22 17:46:23 +03:00
eleksir
63304d6bb9 First run fixes for fortune commands, also fixes for karma 2020-11-22 17:43:05 +03:00
eleksir
ad37a349c1 Implement fortune commands set
+ !f, !ф, !fortune, !фортунка - show random phrase from fortune_mod db
+ !f 1, !ф 1, !fortune 1, !фортунка 1 - show fortune in chat at ~8 am
+ !f 0, !ф 0, !fortune 0, !фортунка 0 - do not show fortune in the morning
+ !f ?, !ф ?, !fortune ?, !фортунка ? - query morning fortune status
2020-11-22 15:17:34 +03:00
eleksir
25b25ade5c lat.pm: use source file with phrases from config 2020-11-21 15:51:35 +03:00
eleksir
e448225a7b Implement !friday and !пятница commands 2020-11-21 15:47:53 +03:00
eleksir
48c07b0073 Use same config parsing method for confcheck.pl too 2020-11-21 15:30:28 +03:00
eleksir
ac8c0f17de Fix karma, fix private commands, actually add !помощь command
* Fix zero length !karma parsing
* In private chat commands not working except !help
* Miss to add !помощь to parser, so it was noop
2020-11-17 01:51:20 +03:00
eleksir
4bf814c473 Move chat commands to botlib.pm, implement !version, !ver, !версия command 2020-11-15 21:43:41 +03:00
eleksir
ba56ea72a2 Fix typo in README.md 2020-11-15 20:40:54 +03:00
eleksir
c6c53d6ebf First karma run fixes
Thanks Ilya Savin for very special utf8 test case for karma.
2020-11-12 20:53:24 +03:00
eleksir
c71ba14bdc Make use of karma module 2020-11-12 00:45:16 +03:00
eleksir
8cb69e554d Add karma module 2020-11-12 00:42:21 +03:00
eleksir
97434d511b Make most of processing errors non-critical. 2020-11-11 23:12:55 +03:00
eleksir
05f8990f5e Fix sending local photos by ctaulien 2020-11-11 21:35:10 +03:00
eleksir
621d19486d Update README.md because of bundling Telegram::Bot with bot as Teapot::Bot 2020-11-07 18:08:04 +03:00
eleksir
57120eb461 Bump ver in Teapot::Bot 0.021 -> 0.022 and clenup modules
- Remove Encode module from cpanfile and telegrambot.pm
+ Add Mojo::IOLoop, Mojo::UserAgent, IO::Socket::SSL
* Sort cpanfile
* Bump version Teapot::Bot 0.021 -> 0.022
* Add aleesa-telegram-bot.pid to .gitignore
2020-11-07 17:54:58 +03:00
eleksir
97eddd414d Lint Teapot::Bot with perlcritic
* Use List::Util' any instead of grep in Base.pm
* Use croak() in Base.pm
2020-10-31 13:49:37 +03:00
eleksir
a480786afa First run of Teapot::Bot fixes.
* Fix typos in Brain.pm
* Fix typos in User.pm
* Implement typing methods in Message object and make use of it
* Fix incorrect syntax of unless loops in telegrambot.pm
* Add Log::Any as it required by Teapot::Bot
* Do not use --update in bootstrap.sh
* Add data/lat to .gitignore
* Load ChatMember and ChatPermissions in Message object, so we can use 'em and avoid crash
* Supply missing $send_args to _post_request
2020-10-30 18:14:00 +03:00
eleksir
43c0286414 Use Teapot' sendChatAction, getChat and getChatMember, remove dups of these subs in telegramlib.pm 2020-10-30 16:15:11 +03:00
eleksir
f0b1ae9c43 Set default action to "typing" if not supplied in sendChatAction() 2020-10-30 16:14:28 +03:00
eleksir
29c1fa8d07 Breaking API changes (handle Mojo loop errors), fix sendMessage method broken in 033441c
* Use general method to handle Mojo loop unsuccessful operations
* Do not die if tg api returns error via Mojo loop, lift up error status to upper layer
* Die with confess only in case of Mojo loop does not returns either is_success or is_error set
* Handle incomming updates related to poll event
* Update inline POD in Brain.pm
* Fix overlooked die removal in sendMessage, now it is croak
2020-10-30 15:42:36 +03:00
eleksir
c1b6ca013d More safe actions in Brain.pm 2020-10-30 15:16:45 +03:00
eleksir
edcd382183 Change fields in Chat object
- Removed all_members_are_administrators
+ Add permissions;
+ Add slow_mode_delay;
2020-10-30 13:58:37 +03:00
eleksir
75ee83c94f Implement ChatPermissions object 2020-10-30 13:39:03 +03:00
eleksir
f93f974cb4 Fix Version in ChatMember.pm 2020-10-30 13:37:40 +03:00
eleksir
a1da4b193d Add field via_bot to Message object 2020-10-30 13:36:38 +03:00
eleksir
0576a1ea57 Implement getChat() with inline POD 2020-10-30 13:10:33 +03:00
eleksir
1a8fa3e089 Add new fields to User and MessageEntity objects 2020-10-29 16:28:43 +03:00
eleksir
74e58db1b8 Implement getChatMember() with inline POD 2020-10-29 16:06:19 +03:00
eleksir
5cba9755af Implement ChatMember object 2020-10-29 15:56:00 +03:00
eleksir
113a918010 Some more work on sendChatAction()
* Fix return value
* Add POD inline for this method
2020-10-29 15:53:31 +03:00