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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_session_orm-0.2.1.tar.gz.
File metadata
- Download URL: nonebot_plugin_session_orm-0.2.1.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.11.0 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa71b10a76c68c5a024c069ab36a21e45a450835f9b58e41d11ea98451e1483e
|
|
| MD5 |
b08783c694f5e2b2ab7e06c29581f74b
|
|
| BLAKE2b-256 |
e788675656a9d106959879706294be4ada0ba2f7ea7ee16ec86e3b77bcc9a757
|
File details
Details for the file nonebot_plugin_session_orm-0.2.1-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_session_orm-0.2.1-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.11.0 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f67cc8a80de2be27da0a1a4c00902c92124291a5e87a070d7649dcad163c4e75
|
|
| MD5 |
c67aa929e34309328e223863106696bc
|
|
| BLAKE2b-256 |
cce37ef0040207e3f4061e771b619a23de7c7d7af1895787cc417d8154f5c2a4
|