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.0b2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51add16171a24edf41592168ae00d555c8a5a67d5edc1ef369335a20a14d9104 |
|
MD5 | 6e8dbfbb37c8dc3c983f8c4548bb38c5 |
|
BLAKE2b-256 | f920b3ed61bcb1a7c1515e47a29955f7f84e0661621dc91ea4698354e7ae340e |
Close
Hashes for nonebot_plugin_session_orm-0.1.0b2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3123f1ba5f877a1c30b88054b1e3c7fd9cedc9a354d7dcb1a739e22a1dd5fe1 |
|
MD5 | 9ccff374eabbff1e49cdfdedc453838c |
|
BLAKE2b-256 | 040ca8f17eacf8807b5278afceb055daf4d24ee55aa7161959c342962370199f |