98 Commits

Author SHA1 Message Date
a8a797a176 Bot decorators will pass only supported arguments to decorated functions
Command, parser, button and query decorators will not pass unsupported 
arguments to their decorated functions anymore (legacy compatibility 
with custombot and new feature for bot).
2019-07-15 13:06:02 +02:00
e412548edf Added Bot() property callback_data_separator and method to set it
It will be used to parse callback data unless a more specific separator 
is passed to @Bot().button decorator. If both are None, data will be a 
string without prefix.
2019-07-15 13:02:44 +02:00
0ac4553591 Documentation 2019-07-13 18:26:12 +02:00
f1a5d244df Method to set event handler in routing table 2019-07-13 16:21:51 +02:00
37d2b6f3d8 Set already_sent value, otherwise it may be referenced before assignment 2019-07-12 14:53:35 +02:00
367b112809 Inline query decorator refactored 2019-07-12 14:40:55 +02:00
d6b7b3002e Fixed bug concerning wrong identifier in callback queries
If 'from' in update do not consider update['message']
2019-07-12 14:40:35 +02:00
b03b24fb2d Logical error in Bot().split_message_text method 2019-07-12 14:31:09 +02:00
7129e20e31 function renamed to handler 2019-07-12 14:23:21 +02:00
e17b77490b Authorization function must accept user_record as argument 2019-07-12 14:23:00 +02:00
87a2f629c7 Commands, aliases and callback handlers must be checked in order 2019-07-12 14:22:34 +02:00
2a900ceea3 Pass user_record in addition to bot and update in routing cascade 2019-07-12 14:21:54 +02:00
34c2135962 Preliminary and final additional tasks implemented 2019-07-12 14:19:15 +02:00
cff3c30481 Command decorator defined 2019-07-12 12:43:49 +02:00
8ee798af5e Get inline_query_id from update 2019-07-12 12:42:26 +02:00
8919fc08a3 Inline query handler refactored 2019-07-12 12:42:26 +02:00
f135279503 Check that session is open before trying to close it 2019-07-11 17:53:28 +02:00
dc5cc92867 Project modules must be imported with davtelepot. prefix 2019-07-06 22:48:55 +02:00
c477f290dd Callback query handler written 2019-07-03 22:29:27 +02:00
fd815e4c64 Wrapper for editMessageText method written 2019-07-03 22:29:02 +02:00
12bc2eba44 Chosen inline result handler written 2019-07-03 20:47:26 +02:00
80ea019d60 Inline query handler written 2019-07-03 19:39:55 +02:00
4036971302 Avoid second try, as it is useless
If first try fails, why should a second try succeed?
2019-07-03 19:13:53 +02:00
0610c0ce19 Wrapper for sendPhoto method
Convert file_path to file_id if possible
2019-07-03 18:50:06 +02:00
589e27bf0e Provide bot with an associated database (SQLite by default) 2019-07-03 18:48:18 +02:00
b1ac8d3d40 Allow photo replies to text message updates 2019-07-03 17:29:30 +02:00
967627c4a2 Path property implemented
Useful when dealing with files
2019-07-03 17:26:31 +02:00
6b907957d5 Never show bot token or session token in log 2019-07-02 14:27:02 +02:00
4f42696a20 TODO: prevent Telegram flood control 2019-07-01 23:37:17 +02:00
e05b0ebe46 Split text in several messages if it hits Telegram limits 2019-07-01 23:36:45 +02:00
af64241d81 Handle command aliases and text message update parsers 2019-07-01 20:54:59 +02:00
7ed430b264 Handle unknown commands 2019-07-01 20:46:38 +02:00
631bda4465 Wrappers for sendMessage and answerInlineQuery methods 2019-07-01 20:39:58 +02:00
4ae826f52c Set default keyboard at setup 2019-07-01 20:34:16 +02:00
8f261a4cfa Indentation 2019-07-01 20:23:00 +02:00
08386d19da Indentation 2019-07-01 20:22:35 +02:00
783040bcd0 Provide a chat_id getter and a method to change it. 2019-07-01 20:20:12 +02:00
55d872fc21 Allow individual text message handlers 2019-07-01 20:17:10 +02:00
97a29406ca Authorization system implemented
Check if user is authorized to perform an action and return an 
authorization denied message if not.
2019-07-01 20:12:06 +02:00
80c746df20 Handle text message updates according to their subtype 2019-07-01 19:56:32 +02:00
ab563c9486 Route updates according to their type calling associated method 2019-07-01 19:55:20 +02:00
2bb0ef9436 Maintenance system implemented
While under maintenance, route updates in a special way.
2019-07-01 16:42:17 +02:00
5a0c658ea3 TelegramBot and TelegramError classes moved to dedicated api module. 2019-06-30 18:52:21 +02:00
3c8995b316 All API methods added manually 2019-06-30 18:47:49 +02:00
bfbf4a17bd API methods added (more to come) 2019-06-30 10:41:02 +02:00
00e09ee79e API methods added (work in progress) 2019-06-30 00:53:49 +02:00
5aade209d3 adapt_parameters method renamed and cleaned 2019-06-29 20:27:46 +02:00
46a8e2f81b Beyond telepot: my own Telegram interaction logics 2019-06-29 20:17:33 +02:00