https://github.com/mirkobrombin/pybotgram
Telegram bot template in python-telegram-bot
https://github.com/mirkobrombin/pybotgram
python-telegram-bot telegram
Last synced: 8 months ago
JSON representation
Telegram bot template in python-telegram-bot
- Host: GitHub
- URL: https://github.com/mirkobrombin/pybotgram
- Owner: mirkobrombin
- License: gpl-3.0
- Created: 2019-08-26T17:34:10.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-12-18T07:17:03.000Z (over 5 years ago)
- Last Synced: 2024-12-28T08:43:12.440Z (over 1 year ago)
- Topics: python-telegram-bot, telegram
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pybotgram
Telegram bot template in python-telegram-bot
## Start from here
* Clone this repo
* Edit bot_token in configs.telegram
* Install python-telegram-bot
```pip install python-telegram-bot```
* run your bot
```python run.py```
## Add new commands
* create new file with your command name in commands directory with start or say as template
* add to commands/__init__
* add to run with dp.add_handler(..)
## Add new dialog
* create new file in dialogs directory with hello as template
* add to dialogs/__init__
* add to dialogs/handler
## Utils?
In utils there are commonly used functions, mainly tools and dummy functions.
### Dummy functions?
The dummy functions are functions that facilitate other functions.
For example user.get_name(..) facilitates the taking of the name and surname if the username is not present.
## Add new utils
Each util should be part of the file that closes a set of functions.
For example get_name is an executable function on the user so it is present in the user file. A function that takes the id of a chat is part of the up (update) file.