A Epic free game info plugin for Nonebot2
Project description
Nonebot Plugin EpicFree
🤖 用于获取 Epic 限免游戏资讯的 Nonebot2 插件
安装方法
使用以下命令之一快速安装(若配置了 PyPI 镜像,你可能无法及时检索到插件最新版本):
nb plugin install nonebot_plugin_epicfree
pip install --upgrade nonebot_plugin_epicfree
重启 Bot 即可体验此插件。
关于依赖版本
以上述方式安装本插件时,可能由于版本差异引起报错,对于新手推荐在安装插件前先存留当前环境依赖版本,以便后续恢复:
# 备份当前的依赖版本
pip3 freeze > requirements.txt
# 尝试安装 nonebot_plugin_epicfree
# 若安装出错,可尝试恢复之前备份的依赖版本
pip3 install -r requirements.txt
若实在无法使用,可以自行将仓库内 nonebot_plugin_epicfree
文件夹复制到 Nonebot2 机器人插件目录下,确保安装过 nonebot_plugin_apscheduler
,重启 bot 即可!
建议学习使用 Python 虚拟环境。
单独加载此插件
在 Nonebot2 入口文件(例如 bot.py
)增加:
nonebot.load_plugin("nonebot_plugin_epicfree")
使用方法
# nonebot_plugin_epicfree/__init__.py#L20
epicMatcher = on_regex("((E|e)(P|p)(I|i)(C|c))?喜(加一|\+1)")
# nonebot_plugin_epicfree/__init__.py#L27
epicSubMatcher = on_regex("喜(加一|\+1)(私聊)?订阅")
发送「Epic喜加一」查找游戏,群组内发送「喜加一订阅」订阅限免游戏资讯。基于正则匹配,所以,甚至「EpIc喜+1」这样的指令都可用!(
限免游戏资讯订阅默认每周六 08:08:08 发送,如需自定义请在 .env
中添加格式如下(四个数字依次代表 day_of_week
hour
minute
second
)的配置:
epic_scheduler="5 8 8 8"
特别鸣谢
@nonebot/nonebot2 | @Mrs4s/go-cqhttp | @DIYgod/RSSHub | @SD4RK/epicstore_api
作者是 Nonebot 新手,代码写的较为粗糙,欢迎提出修改意见或加入此插件开发!溜了溜了...
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_epicfree-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ab41d7a2e8b7b57830832daa856dffa7c10aeedf9a9e57728d572f2ddd25241 |
|
MD5 | a73f985ac18c16f78026fc59ae92a7c4 |
|
BLAKE2b-256 | 2bed2174e5bd028f4184731049430257d132153aaeb82e27508f2d9a0e29f741 |
Hashes for nonebot_plugin_epicfree-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e20f38f9f1f83e3fdc37cb7be5f260f2b9772a289a0aabecd0a812b190d0eda |
|
MD5 | 240b4ee5ed44cf42e6c006c3352d4f6a |
|
BLAKE2b-256 | a7c5861a31e02ae89d1556de6e8f7ecbc0eb75d2e6537b6c39b6504c9786f035 |