sqlite-fsm-storage 3.0.0

Creator: bradpython12

Last updated:

0 purchases

sqlite-fsm-storage 3.0.0 Image
sqlite-fsm-storage 3.0.0 Images

Languages

Categories

Add to Cart

Description:

sqlitefsmstorage 3.0.0

AioSQLiteStorage is a modern async FSM Storage for Telegram Bots on Python. It is surprisingly easy to connect and use.
Install
$ pip install sqlite-fsm-storage
Example of use in a telegram bot on aiogram:
from aiogram import Bot, Dispatcher
from aiogram.dispatcher.dispatcher import CancelledError
from sqlite_fsm_storage import AioSQLiteStorage
import asyncio

async def main():
bot = Bot(token='YOUR_BOT_TOKEN', parse_mode='HTML')
storage = AioSQLiteStorage()
await storage.start()
dp = Dispatcher(storage=storage)
await bot.delete_webhook(drop_pending_updates=True)
try:
await dp.start_polling(bot, allowed_updates=['message', 'callback_query'])
except CancelledError:
pass
finally:
await bot.session.close()
await storage.close()

if __name__ == '__main__':
asyncio.run(main())
Developer - Blaze Egor

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.