Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yamnikov-oleg/pythontalk_gatebot
A Telegram bot, guarding the @python_talk group
https://github.com/yamnikov-oleg/pythontalk_gatebot
bot telegram-bot
Last synced: about 5 hours ago
JSON representation
A Telegram bot, guarding the @python_talk group
- Host: GitHub
- URL: https://github.com/yamnikov-oleg/pythontalk_gatebot
- Owner: yamnikov-oleg
- License: mit
- Created: 2019-03-05T16:07:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-11T00:20:42.000Z (over 1 year ago)
- Last Synced: 2023-03-03T01:37:48.273Z (over 1 year ago)
- Topics: bot, telegram-bot
- Language: Python
- Homepage:
- Size: 99.6 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python Talk Gate Bot
Telegram bot used for @python_talk group to quiz new members on basic Python knowledge before letting them chat.
## Installation
The bot requires Python of version 3.6 or higher.
1. Create a virtual environment and activate it:
```
$ virtualenv -p python3 venv
$ source ./venv/bin/activate
```
2. Install all the requirements:
```
$ pip install -r requirements.txt
```
3. Configure the bot accordingly (see "Configuration" section).
4. Apply migrations:
```
$ alembic upgrade head
```
5. Run the bot:
```
$ ./run.py
```## Configuration
Bot's configuration is located in the `config` directory:
* `base.py` - default configuration.
* `test.py` - test configuration, used when running tests.Please, do not edit these files, unless you're developing the bot.
To configure the bot on deployment, create a new file `local.py` in this directory with the following contents:
```python
from .base import BaseConfigclass LocalConfig(BaseConfig):
BOT_TOKEN = ''
```Fill in `BOT_TOKEN` variable. You can overwrite any other variable available in `base.BaseConfig` if needed.
`local.py` is already included in `.gitignore`.
## Development commands
* Run tests:
```
$ pytest
```
* Auto-generate a new migration:
```
$ alembic revision --autogenerate -m "You migration message"
```
Make sure you have the latest version of DB schema before generating new migrations.
* Run IPython shell with DB session and bot models in scope:
```
$ ./shell.py
```