A Genshin GachaLogs analysis plugin for Nonebot2
Project description
Nonebot Plugin GachaLogs
🤖 用于统计及导出原神祈愿记录的 Nonebot2 插件
安装方法
使用以下命令安装插件本体 (插件暂未发布于 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 存储桶 SecretIdcos_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
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
Hashes for nonebot-plugin-gachalogs-0.1.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b64769782942b0dcc9831cdbfaf6e18478b1684f368ce8fac918fe45fb637bd4 |
|
MD5 | 505bf9520cf7bbc8c4bc5b8c2abeebf9 |
|
BLAKE2b-256 | 5f2526861a92f46ad4ec0063a4cea2bb2464caf6cf3a41290821d0e1bf5cbc84 |
Hashes for nonebot_plugin_gachalogs-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c9775ed8c3479d8984ac9e060fbf5cbb2617525435c7745dc336cb45eb1f317 |
|
MD5 | f6b7e18087f962630d1324d3b09a3e53 |
|
BLAKE2b-256 | 554f172e0aa1972843fb34ff2c386be6203830ffb349f6f0c388e617a101d081 |