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.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27ff336a4a529b80b1d62157c47e781ea851326e8633bcc71fae98e6cdaf1449 |
|
MD5 | b0fb7611e8a165cd3ce0bfabd1980133 |
|
BLAKE2b-256 | 6408af5bdb044a0e31f60252b3775cf1044191e0e2cec5924376be40ac85e97f |
Close
Hashes for nonebot_plugin_session_orm-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 411b050ce14e62122e85a9aa7cbdcd0385c6562b741b0b92e2d63924c9c9a37e |
|
MD5 | 33f2adfbad962af5bda413b7b0313fe7 |
|
BLAKE2b-256 | bfc730aefceec90ebed03f3d33650723e9078f20ef7590f0d73fc1428d096940 |