session 插件 orm 扩展
Project description
nonebot-plugin-session-orm
为 session 提供数据库模型及存取方法
安装
- 使用 nb-cli
nb plugin install nonebot_plugin_session_orm
- 使用 pip
pip install nonebot_plugin_session_orm
使用
from nonebot import require
require("nonebot_plugin_session_orm")
from nonebot_plugin_session import EventSession
from nonebot_plugin_session_orm import get_session_persist_id, get_session_by_persist_id
@matcher.handle()
async def handle(session: EventSession):
persist_id = await get_session_persist_id(session) # 存储 session,返回 persist_id
session_loaded = await get_session_by_persist_id(persist_id) # 通过 persist_id 获取 session
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for nonebot_plugin_session_orm-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 420e210898a3f348cebbb4ea0816bab66f3299c7b0c01e929a01967d60cc438c |
|
MD5 | 637077c59f7e90369488926550601dbf |
|
BLAKE2b-256 | bf74566617f4d38daf43f673820d362863e81741a386df2d79ba40fe42f4e78c |
Close
Hashes for nonebot_plugin_session_orm-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0a6009803feccf4e98db483e1f9072122ddbca40df0b2d1b45741c8e5332acb |
|
MD5 | 34ea06c240ab263dd44b20c0778c0785 |
|
BLAKE2b-256 | 377fd1e2e4a6a3b4c0f8489697ab04ed1136bc67982116c6df2ff7dfb092c381 |