Commit Graph

255 Commits

Author SHA1 Message Date
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
eleksir
45318757df Implement sendChatAction() 2020-10-28 18:19:29 +03:00
eleksir
033441c513 First touch to satisfy perlcritic 2020-10-28 18:18:09 +03:00
eleksir
f816840e14 Now Telegram::Bot is Teapot::Bot 2020-10-28 18:12:49 +03:00
eleksir
c3818e5dee Vendor Telegram::Bot 2020-10-28 18:06:21 +03:00
eleksir
c9b46cc6f0 Use sendChatAction() correctly 2020-10-28 16:25:54 +03:00
eleksir
0397b3c9cf Rename .perlcriticrc file 2020-10-28 15:20:38 +03:00
eleksir
295835c283 Add famous latin prases module 2020-10-22 13:49:45 +03:00
eleksir
9c629a8dbc Use perlcritic to lint the code, make it happy 2020-10-19 18:01:47 +03:00
eleksir
9abb221dac Make bot more human-like by delaying answers
- Greet newcommers with notable randomized delay + send "typing", pretending we are real human :)
- Make 1-2 second delay in group chat before answer.
2020-10-10 14:17:25 +03:00
eleksir
0d0b8bb4c2 Add one more common phrase 2020-10-03 19:12:05 +03:00
eleksir
04706f20e2 Use user id in mention of newcommers when greet them 2020-09-27 14:49:32 +03:00
eleksir
1567fbe0db New logging, handle bot quote in groups, newcommer greets reworked
+ More sane and verbose logging
* Newcommer greet now should now mention newcommer
+ If someone in group quote bot's phrase, bot should answer
* Move some subs related to framework to telegramlib.pm
* Handle (log only for now) sent media - documents, stickers, photos in public chats (voice, audio, video still unhandled)
2020-09-26 21:36:37 +03:00
eleksir
376cbdfbe5 Add debug messages to some events 2020-09-21 02:13:20 +03:00
eleksir
f0d8e90441 Add date to logger() messages like in bsd syslog 2020-09-21 02:11:47 +03:00
eleksir
1822054f03 Fix fool typo that prevents daemon from start 2020-09-21 02:09:21 +03:00
eleksir
ab27431e83 Edit spelling and enhance README.md 2020-09-19 14:57:05 +03:00
eleksir
d53ee53ad8 Use Cwd::utf8 to cope with returning string ut8-ness
* Use Cwd::utf8
* Sort cpanfile require, remove duplicates, add Cwd::utf8
* Add check on first call of abs_path()
2020-09-19 14:48:29 +03:00
eleksir
9461042ec4 Use botlib own trim() 2020-09-19 14:43:48 +03:00
eleksir
04057e10e1 Paint help message in markdown 2020-09-12 14:02:41 +03:00
eleksir
476519efc8 More accurate detect permission to talk in group chats 2020-09-12 00:37:11 +03:00
eleksir
e7f0eaeceb Use relaxed json parser to allow comments in configs 2020-09-12 00:30:30 +03:00
eleksir
814a7ddb2b Create pid file in workdir if run directly from unpriv. user 2020-09-11 11:20:21 +03:00
eleksir
b11496a7b4 Enhance newcommer greet 2020-09-11 11:20:21 +03:00
eleksir
7cce6a9413 Deejay incomming phrase munging code 2020-09-11 11:20:21 +03:00
eleksir
7218c7d510 Require perl-5.18.0 to properly lc() and uc() unicode strings 2020-09-11 11:20:21 +03:00
eleksir
c8819676e7 Add more random phrases 2020-09-11 11:20:21 +03:00