Skip to main content

nonebot-plugin-op-finder

✨ Only for kaiheila adaptor ✨

license pypi python

📖 介绍

显示服务器中当前正在玩原神的玩家,效果图见下文。

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-op-finder
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-op-finder
pdm
pdm add nonebot-plugin-op-finder
poetry
poetry add nonebot-plugin-op-finder
conda
conda install nonebot-plugin-op-finder

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot_plugin_op_finder"]

⚙️ 配置

kaiheila adaptor 相关配置请见kaiheila adaptor 使用指南

本插件需要在 nonebot2 项目的.env文件中添加下表中的配置

配置项 必填 默认值 说明
kook_auth_key 是 无 自己账号的kook鉴权cookie

因为目前KOOK v3 api中没有获得玩家在玩状态的接口,本插件通过v2 api获取玩家在玩状态。

由于v2 api不受官方支持,需要手动抓包获取一个账号的鉴权cookie,用以调用api。

  1. 登录网页版KOOK,随便进入一个服务器,打开浏览器控制台

  2. 控制台切换到Network(网络)选项卡

  3. KOOK中随意点击一个用户的头像,打开资料面板

  4. 此时Network选项卡中应会抓到若干请求,随意选择一个v2api的请求查看,如 https://www.kookapp.cn/api/v2/users/<用户id>?guild_id=<服务器id>

  5. 查看请求的Headers选项卡中的Request Headers(请求头),找到Cookie键,形如

    Cookie: auth=<kook_auth_key>; PHPSESSID=<something>; _csrf_chuanyu=<something>
    
  6. 其中<kook_auth_key>即为我们需要的配置项

此实在是不得已而为之的下策,若v3 api有获取在玩状态的方法,或更方便获取v2 api auth key的方法,敬请告知。

🎉 使用

指令表

指令 权限 需要@ 范围 说明
/查找原批 || /原批 || /op 所有人 否 群聊 触发插件

指令命名纯属调侃,无恶意

效果图

Metadata

Release files for nonebot-plugin-op-finder 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-op-finder 1.0.0
File Size Uploaded Provenance Actions
nonebot-plugin-op-finder-1.0.0.tar.gz 125.0 kB Without provenance Details for nonebot-plugin-op-finder-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-op-finder 1.0.0
File Interpreter ABI Platform Actions
nonebot_plugin_op_finder-1.0.0-py3-none-any.whl Python 3 none any Details for nonebot_plugin_op_finder-1.0.0-py3-none-any.whl

Total release size: 143.5 kB

Release files / nonebot-plugin-op-finder-1.0.0.tar.gz

Download URL nonebot-plugin-op-finder-1.0.0.tar.gz
Size 125.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5e469f5cb48cb16e0912579b6bf3354964e08387bb68009f16f338bbf351d1bf
BLAKE2b-256 checksum
How to use checksums
37bbcce77ef4b18c8de4334c0d8efcec80b1ffbfed09fe99e8139658671138a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / nonebot_plugin_op_finder-1.0.0-py3-none-any.whl

Download URL nonebot_plugin_op_finder-1.0.0-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0a89615b0a4548d332e1ad9babb2c68ccc97b0e91f649b4c2024a92075eb55d
BLAKE2b-256 checksum
How to use checksums
63baca0e9b7d12647001a0d41bd88dae53a0fd95e1b06268134c8e7a8950d40f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Security for nonebot-plugin-op-finder 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page