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.0b1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79277e4ccb2241916342e8b72db980e331da277b4f24c2d0d06c02977b13676f |
|
MD5 | bcde21e69c3200133db6e8c9958c0bb3 |
|
BLAKE2b-256 | dc007a0a2d11302238c552d8f46c2273e9bdedac4d064c3dfba03ef3454d85f9 |
Close
Hashes for nonebot_plugin_session_orm-0.1.0b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba500df0910cb9afe8528bd543287d243ee2c84d6e43f7ed2ca2dde51e0a99ca |
|
MD5 | f21638332b1de0e34000ece90402769a |
|
BLAKE2b-256 | 9756a47fe6b3e25a9cc6783a4878eee80e39f351691ac61abb7bdca9746bb7f1 |