Commit Graph
100 Commits
Author SHA1 Message Date
Davte 67d52a8fd8 languages module added to __all__ 2020-02-17 13:43:07 +01:00
Davte 61ea563bfa Minor bugs fixed in suggestions module 2020-02-17 12:22:42 +01:00
Davte f17333ca42 Provide a default multilanguage suggestions module 2020-02-17 12:14:52 +01:00
Davte ceef3103f4 Prevent double keyword argument in async_wrapper 2020-02-16 13:40:45 +01:00
Davte 23b04d6207 Coroutine wrapper default arguments 2020-02-16 12:04:04 +01:00
Davte 0a05c1e1c1 Minor bug fixes 2020-02-14 17:42:15 +01:00
Davte ecdb639741 Include administration tools and helper modules in __all__ 2020-02-14 17:11:40 +01:00
Davte 61fe8e0591 Pass errors parameter in async_request function 2020-02-12 15:34:54 +01:00
Davte f73f438d32 Use built-in decoding feature of aiohttp.ClientResponse 2020-02-11 17:28:37 +01:00
Davte ab6849b5e0 Replace multiple whitespace in strings to be parsed 2020-02-11 14:43:15 +01:00
Davte c2b50bc42c Whitespace 2020-02-11 11:38:49 +01:00
Davte 9eea9a6632 Merged version 2020-02-10 15:55:12 +01:00
Davte 7f7ba35276 Merge branch 'develop' of ssh://davte.it:8445/Davte/davtelepot into develop 2020-02-10 15:54:49 +01:00
Davte 709f230266 Provide a shared_data attribute 2020-02-10 15:54:34 +01:00
Davte ebc7d93d95 Version update 2020-01-24 13:34:49 +01:00
Davte c8a98b035f Merge branch 'develop' of ssh://gogs.davte.it:8445/Davte/davtelepot into develop
# Conflicts:
#	davtelepot/__init__.py
2020-01-24 13:34:25 +01:00
Davte 87431b8596 Version alignment (again, hopefully for the last time) 2020-01-19 19:26:25 +01:00
Davte 19aac0e874 Version alignment (again) 2020-01-19 19:18:47 +01:00
Davte 0513c949e5 Version alignment 2020-01-19 19:14:57 +01:00
Davte 4f827587ee Mutable defaults removed 2020-01-19 19:09:58 +01:00
Davte 4abad7c423 Small improvement in download_file method
Generate new file name if no file name is provided; make sure it does 
not exist.
2020-01-08 10:30:47 +01:00
Davte 8565a96e15 Add users table with its fields if missing
Refactoring of previous version patch
2020-01-05 19:33:05 +01:00
Davte 33c242efc6 Release user table addition if missing 2020-01-05 19:27:02 +01:00
Davte 1511b4742f Add user table if missing 2020-01-05 19:24:42 +01:00
Davte 581cfd750e Function to download files implemented 2020-01-04 18:34:17 +01:00
Davte f9ec8a4419 Missing language strings should be logged as warnings, not errors. 2020-01-04 18:33:53 +01:00
Davte 4acd10d344 Individual voice handler now supported 2020-01-04 17:21:02 +01:00
Davte 383418d955 send_voice method implemented 2020-01-04 15:09:16 +01:00
Davte 9ae8058017 send_audio method implemented
Send audio files by their id if available, otherwise send audio file 
from local path and store its telegram_id.
2020-01-04 12:50:44 +01:00
Davte 807c62ca95 os-agnostic way to get file path 2019-12-29 22:51:05 +01:00
Davte 4c1ffb3382 Hack no longer needed to encode filenames
Thanks to tirkarthi.github.io, a simple parameter `quote_fields` can 
solve the issue which needed a messy workaround until now.
2019-12-27 21:08:29 +01:00
Davte 189a10ddbe utilities is a project module, not a third party one 2019-12-01 18:21:01 +01:00
Davte e7a30d0369 Allow command aliases to be a /command too. 2019-12-01 18:20:39 +01:00
Davte d30ed21de2 Typos 2019-12-01 12:42:05 +01:00
Davte 886c0c95e4 Typo 2019-12-01 12:40:05 +01:00
Davte 920554d465 Print statements removed 2019-11-28 18:12:15 +01:00
Davte 85341d7064 Placeholder system
Send a placeholder message or chat_action if the request takes some 
time.
2019-11-28 18:08:58 +01:00
Davte 74079fb481 Do not encode pictures as utf-8 2019-10-01 15:00:00 +02:00
Davte f02aa38200 Hide CSV button if no query_id is available 2019-09-29 20:18:14 +02:00
Davte 0e268414f9 Prevent UnboundLocalError 2019-09-29 20:16:39 +02:00
Davte aa6f45887e Allow addition of help sections 2019-08-18 23:23:48 +02:00
Davte 45e2bbfa3d Support for multilanguage /help command
A bot guide may be built automatically using @bot.command decorator.
2019-08-18 20:55:47 +02:00
Davte a2365f815d Handle unknown exceptions in getUpdates method 2019-08-15 13:45:32 +02:00
Davte 72a7dd5a5f Catch and return unexpected exceptions during API calls 2019-08-15 11:35:24 +02:00
Davte f525caa2e5 Comments 2019-08-05 21:59:35 +02:00
Davte 91f9119ad5 Return result string if it is not a dict 2019-08-05 21:44:32 +02:00
Davte 3fbe4b93e9 get_message method is inherited and must not be overwritten 2019-08-05 21:43:58 +02:00
Davte e0f1199768 Interrupt if unable to start webapp 2019-08-04 22:27:10 +02:00
Davte e6ed4176ad Avoid overwriting self.messages 2019-08-04 18:10:02 +02:00
Davte 493c127469 Make custombot.Bot().command pass reply_keyboard_button parameter 2019-08-04 18:07:56 +02:00
Davte 5fb28a5c7a Patch for custombot 2019-08-04 17:57:02 +02:00
Davte 6f45b906ff Add reply keyboard buttons to aliases if necessary 2019-07-27 00:00:21 +02:00
Davte 1b9c039549 Avoid returning fake log_file_name 2019-07-26 23:43:11 +02:00
Davte 62b390b7b9 Multilanguage support for reply keyboard buttons 2019-07-26 23:37:23 +02:00
Davte 02ce581ced Merge branch 'develop' of ssh://davte.it:8445/Davte/davtelepot into develop 2019-07-26 20:21:20 +02:00
Davte 82b203b5ab /maintenance command implemented 2019-07-26 20:20:53 +02:00
Davte 656e08fc1a /maintenance command implemented 2019-07-26 19:34:38 +02:00
Davte 417dcb63e4 /log and /errors commands implemented
Receive bot general log and errors log via bot itself
2019-07-26 18:22:27 +02:00
Davte 7a994ca957 Function to send part of text files 2019-07-26 18:21:39 +02:00
Davte c56c37c351 Make send_document return an Exception if document to send is not found 2019-07-26 14:03:33 +02:00
Davte 1297402357 /select command implemented
It calls _query_command function
2019-07-26 11:42:41 +02:00
Davte 39e7d8b783 Provide help if /query command is called with no text 2019-07-26 11:05:37 +02:00
Davte 9961c2734c /query command implemented
Run a SQL query on bot database and receive the results as a message or 
a CSV file
2019-07-26 10:56:48 +02:00
Davte d60637a3b7 Consider user_record in /talk related function
Thus, user-selected language will be applied in get_message method calls
2019-07-26 10:56:01 +02:00
Davte d765aea71e Function to send CSV files 2019-07-26 10:54:33 +02:00
Davte ad5ec33869 Close buffered_file only if it exists 2019-07-26 10:36:30 +02:00
Davte 80418bd11c Allow keyword arguments in custombot initialization 2019-07-22 21:59:31 +02:00
Davte 637dca7af2 handle_location method deprecated 2019-07-22 18:23:39 +02:00
Davte c1c9f7dd78 Language suppport for /language command 2019-07-22 12:36:38 +02:00
Davte 3f4417b84b Added support for multilanguage command descriptions 2019-07-21 20:47:54 +02:00
Davte b1c7ee4299 Get database url from database object 2019-07-21 20:08:01 +02:00
Davte cb64443af2 New version 2019-07-21 17:46:28 +02:00
Davte 9890988f7f /db command implemented 2019-07-21 17:46:06 +02:00
Davte f5c661925c Close buffered_file only if it exists 2019-07-21 17:45:39 +02:00
Davte 04827b4691 davtelepot.bot.Bot().send_document method implemented
It accepts document handlers, Telegram `document_id`s or file paths
2019-07-21 17:32:27 +02:00
Davte 37a2e6a9f2 Use default_message argument of get_message method 2019-07-21 15:56:30 +02:00
Davte fba4e4c143 get_message method now supports a default_message optional kwarg 2019-07-21 15:39:59 +02:00
Davte 6e95de61e9 More elegant way of /stopping bots 2019-07-20 21:05:40 +02:00
Davte 191a2d2ecb /stop command implemented 2019-07-20 20:34:39 +02:00
Davte ab63f56276 Log identifier if get_user_identifier method fails 2019-07-20 19:29:00 +02:00
Davte adf67c9ce1 Restart command implemented; user_record variable renamed 2019-07-20 17:09:14 +02:00
Davte 00bd5b24cd Return instructions if /auth is called without arguments 2019-07-20 13:57:02 +02:00
Davte ec8a882eba Logical error fixed
When selected_language_code was not a field of `user` table, it was 
never added
2019-07-20 13:17:15 +02:00
Davte 907d27b554 Ensure that field selected_language_code is added if not present 2019-07-20 13:13:18 +02:00
Davte c43c0be4fa Multilanguage support
Support /language command (and buttons) to make user choose a language.
2019-07-20 13:05:26 +02:00
Davte 10d53e8e1e Insert selected_language_code for new users (set to None). 2019-07-20 13:04:54 +02:00
Davte 4b3228b6bc /auth command and buttons 2019-07-20 00:04:55 +02:00
Davte 81cf37b0eb Option to switch off telegram profile linking 2019-07-19 22:59:32 +02:00
Davte dba337f5dc Authorization-related multilanguage messages 2019-07-19 19:12:10 +02:00
Davte 382ee2a4f1 Store users data and track changes 2019-07-19 18:17:19 +02:00
Davte cab54806a7 More general refactoring 2019-07-19 17:25:47 +02:00
Davte 4dd88a0b2c Authorization module to handle roles 2019-07-19 17:08:53 +02:00
Davte 3c12b00839 custom_parser does not exist anymore 2019-07-19 16:45:32 +02:00
Davte 6075e5513b Support for multiple languages 2019-07-19 16:40:46 +02:00
Davte a085fddf31 Use dot for relative imports 2019-07-19 12:21:11 +02:00
Davte e22854c77d aiohttp.web.Application does not take a loop argument anymore 2019-07-19 10:50:29 +02:00
Davte 65559814a4 Package information updated 2019-07-19 10:47:46 +02:00
Davte e8cf7cd421 Version 13 exposed secrets 2019-07-19 10:07:24 +02:00
Davte 600e3a3826 New version (12 was deleted due to token exposure) 2019-07-19 10:03:29 +02:00
Davte 44baf46406 Build wheels from sdist output, since the former ignores MANIEFST.in 2019-07-19 10:02:46 +02:00