Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_session_orm-0.2.0.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page