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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb1b83c95b3a006125f02ae9d6ba855d0579ce9cb07da568c88b7ba6a0b86e24 |
|
MD5 | ddd712fdfb1e1198072a1aadace3d429 |
|
BLAKE2b-256 | d0ce3324e66a4ca567e88e5bdea8b456443182f7135fe2321915d2fb2faf3b55 |
Close
Hashes for nonebot_plugin_session_orm-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c6d4b33109ab851db9f440ff6efcb12309fb6666c1e698b030826d27bb63e0c |
|
MD5 | a87636e6f80396f43d9b00c1fc5807c2 |
|
BLAKE2b-256 | 98d8eef66d68859491c26ff382cc7a945d18aa650e9f7017875a17bc127585bb |