Skip to content

Repository files navigation

nonebot-plugin-session-orm

session 提供数据库模型及存取方法

安装

  • 使用 nb-cli
nb plugin install nonebot_plugin_session_orm
  • 使用 pip
pip install nonebot_plugin_session_orm

使用

fromnonebotimportrequirerequire("nonebot_plugin_session_orm")
fromnonebot_plugin_sessionimportEventSessionfromnonebot_plugin_session_ormimportget_session_persist_id, get_session_by_persist_id@matcher.handle()asyncdefhandle(session: EventSession):
persist_id=awaitget_session_persist_id(session) # 存储 session,返回 persist_idsession_loaded=awaitget_session_by_persist_id(persist_id) # 通过 persist_id 获取 session

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages