diff options
author | clarkzjw <[email protected]> | 2023-02-22 00:26:18 -0800 |
---|---|---|
committer | clarkzjw <[email protected]> | 2023-02-22 00:26:18 -0800 |
commit | 0590292da6eec52e6f569749037c8f8f7bdd948e (patch) | |
tree | bf4a2f875dd96ad5a0cea3972e682680531aa50b /bot.py | |
parent | 97735d9e3d7b2d52572df736d8ab0778db8b7024 (diff) | |
download | swarm2fediverse-0590292da6eec52e6f569749037c8f8f7bdd948e.tar.gz |
add custom webhook example
Diffstat (limited to 'bot.py')
-rw-r--r-- | bot.py | 40 |
1 files changed, 34 insertions, 6 deletions
@@ -1,12 +1,40 @@ | |||
1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
2 | 2 | ||
3 | from telegram.ext import Application, CallbackQueryHandler, CommandHandler, MessageHandler, filters, ConversationHandler | ||
4 | import logging | 3 | import logging |
5 | from callback import callback_skip_media, callback_location_sharing, callback_manual_location, \ | 4 | |
6 | callback_location_confirmation, callback_location_keyword_search, callback_skip_location_keyword, \ | 5 | from telegram.ext import ( |
7 | callback_add_comment, callback_skip_comment, callback_add_media | 6 | Application, |
8 | from config import WAIT_LOCATION, LOCATION_SEARCH_KEYWORD, LOCATION_CONFIRMATION, ADD_MEDIA, ADD_COMMENT, BOT_TOKEN | 7 | CallbackQueryHandler, |
9 | from command import start_command, cancel_command, help_command | 8 | CommandHandler, |
9 | MessageHandler, | ||
10 | filters, | ||
11 | ConversationHandler | ||
12 | ) | ||
13 | |||
14 | from callback import ( | ||
15 | callback_skip_media, | ||
16 | callback_location_sharing, | ||
17 | callback_manual_location, | ||
18 | callback_location_confirmation, | ||
19 | callback_location_keyword_search, | ||
20 | callback_skip_location_keyword, | ||
21 | callback_add_comment, | ||
22 | callback_skip_comment, | ||
23 | callback_add_media | ||
24 | ) | ||
25 | from command import ( | ||
26 | start_command, | ||
27 | cancel_command, | ||
28 | help_command | ||
29 | ) | ||
30 | from config import ( | ||
31 | WAIT_LOCATION, | ||
32 | LOCATION_SEARCH_KEYWORD, | ||
33 | LOCATION_CONFIRMATION, | ||
34 | ADD_MEDIA, | ||
35 | ADD_COMMENT, | ||
36 | BOT_TOKEN | ||
37 | ) | ||
10 | 38 | ||
11 | logging.basicConfig( | 39 | logging.basicConfig( |
12 | format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO | 40 | format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO |