Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mortafix/redispersistence
A python module to make your Telegram bot persistent using Redis
https://github.com/mortafix/redispersistence
Last synced: 2 days ago
JSON representation
A python module to make your Telegram bot persistent using Redis
- Host: GitHub
- URL: https://github.com/mortafix/redispersistence
- Owner: Mortafix
- License: mit
- Created: 2021-01-05T08:30:51.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-23T07:35:23.000Z (almost 2 years ago)
- Last Synced: 2024-10-29T01:29:00.051Z (18 days ago)
- Language: Python
- Size: 4.88 KB
- Stars: 9
- Watchers: 2
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Setup
You can find the package, [here](https://pypi.org/project/redis-persistence/).
```
pip3 install redis-persistence
```# Requirements
* Python 3.8
* Redis 3.5# Import
```python
from redispersistence.persistence import RedisPersistence
```# Usage
You need to use this persistence with [pyton-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot) module.
```python
redis_instance = Redis(host='localhost', port=6379, db=0)
persistence = RedisPersistence(redis_instance)
updater = Updater(BOT_TOKEN, persistence=persistence)
```