Skip to main content

A Genshin GachaLogs analysis plugin for Nonebot2

Reason this release was yanked:

missing import cacheData

Project description

Nonebot Plugin GachaLogs


🤖 用于统计及导出原神祈愿记录的 Nonebot2 插件


actions license pypi python


安装方法

使用以下命令安装插件本体 (插件暂未发布于 PyPI)

# 从 Git 安装
git clone https://github.com/monsterxcn/nonebot-plugin-gachalogs.git
cd nonebot_plugin_gachalogs
cp -r nonebot_plugin_gachalogs /path/to/nonebot/plugins/
cp -r resources/gachalogs /path/to/resources/

然后检查一下,别忘了安装依赖 matplotlib Pillow xlsxwriter

python3 -m pip install matplotlib Pillow xlsxwriter
从 PyPI 安装
# 从 PyPI 安装
python3 -m pip install nonebot-plugin-gachalogs

从 PyPI 安装后需要手动将 resources/gachalogs 文件夹内资源下载到服务端。

打开 Nonebot2 正在使用的 .env 文件,参考 .env.example 添加以下配置:

  • resources_dir 包含 gachalogs 文件夹的上级目录路径
  • gacha_expire_sec 祈愿历史记录本地缓存过期秒数,不设置默认 1 小时
  • cos_bucket_name 腾讯云 COS 存储桶名称
  • cos_bucket_region 腾讯云 COS 存储桶地域
  • cos_secret_id 腾讯云 COS 存储桶 SecretId
  • cos_secret_key 腾讯云 COS 存储桶 SecretKey

* 关于腾讯云 COS 的配置仅用于私聊导出文件

重启 Bot 即可体验此插件。

使用方法

插件支持以下命令:

  • 抽卡记录 / ckjl

    返回一张统计饼图,样式与 https://genshin.voderl.cn/ 一致。

    初次使用要求输入一次祈愿历史记录链接,只要回复的内容中含有即可,不必手动截取准确的链接地址。

    附带 -f / --force 可要求强制获取最新祈愿记录,祈愿记录结果默认缓存 1 小时。

    祈愿统计图

  • 抽卡记录导出 / ckjldc

    导出祈愿历史记录文件,可选格式包括 .xlsx 表格和 .json 文件,均符合 统一可交换祈愿记录标准(UIGF)格式。

    附带 j / json / u / uigf 可指定导出 .json 文件,否则默认导出 .xlsx 表格。

    管理员可使用 ckjldc [qq] [format] 格式命令导出指定 QQ 的祈愿历史记录。

    此功能需要配置腾讯云 COS 以实现私聊文件发送,创建的存储桶建议设为私有读写。

    导出示意图

  • 抽卡记录重置 / ckjlcz

    重置本地缓存的抽卡记录,不带参数默认重置自己的记录,可通过手动输入 QQ 号或 @某人 的方式指定操作用户。非管理员只能重置自己的记录。

    这里 重置 的意思是删除 / 清空,一旦删除记录将无法恢复,所以此命令一般会要求重新发送附带 -f 的命令以确认操作。你也可以在第一次发送命令时就附带 -f 直接确认操作。

特别鸣谢

@nonebot/nonebot2 | @Mrs4s/go-cqhttp | @sunfkny/genshin-gacha-export | @voderl/genshin-gacha-analyzer

插件主要功能是从 @sunfkny/genshin-gacha-export 抄的,溜溜…

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-gachalogs-0.1.4.tar.gz (20.6 kB view hashes)

Uploaded Source

Built Distribution

nonebot_plugin_gachalogs-0.1.4-py3-none-any.whl (22.0 kB view hashes)

Uploaded Python 3

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