Git Product home page Git Product logo

nonebot_plugin_epicfree's Introduction

NoneBot Plugin EpicFree


🤖 用于获取 Epic 限免游戏资讯的 NoneBot2 插件


actions license pypi python


安装方法

使用以下命令之一快速安装(若配置了 PyPI 镜像,你可能无法及时检索到插件最新版本):

nb plugin install nonebot_plugin_epicfree

pip install --upgrade nonebot_plugin_epicfree

重启 Bot 即可体验此插件。

关于 NoneBot2 及相关依赖版本

在已淘汰的 NoneBot2 适配器 nonebot-adapter-cqhttp 下,切记不要使用 pipnb_cli 安装此插件。通过拷贝文件夹 nonebot_plugin_epicfree 至 NoneBot2 插件目录、手动安装 nonebot-plugin-apschedulerhttpx 依赖的方式仍可正常启用此插件。在未来某个版本会完全移除该适配器支持,请尽快升级至 nonebot-adapter-onebot

关于 go-cqhttp 版本

插件发送消息依赖 @Mrs4s/go-cqhttp 的合并转发接口,如需启用私聊响应请务必安装 v1.0.0-rc2 以上版本的 go-cqhttp。

使用方法

# nonebot_plugin_epicfree/__init__.py#L27
epic_matcher = on_regex(r"^(epic)?喜(加|\+|+)(一|1)$", priority=2, flags=IGNORECASE)

# nonebot_plugin_epicfree/__init__.py#L39
sub_matcher = on_regex(r"^喜(加|\+|+)(一|1)(私聊)?订阅(删除|取消)?$", priority=1)
  • 发送「喜加一」查找限免游戏
  • 发送「喜加一订阅」订阅游戏资讯
  • 发送「喜加一订阅删除」取消订阅游戏资讯

* 插件响应基于正则匹配,所以,甚至「EpIc喜+1」这样的指令都可用!

环境变量

RESOURCES_DIR="/data/bot/resources"
EPIC_SCHEDULER="8 8 8"

限免游戏资讯订阅功能默认在机器人根目录下 /data/epicfree 文件夹内生成配置文件。定义 RESOURCES_DIR 环境变量即可指定用于存放订阅配置的文件夹,填写包含 epicfree 文件夹的 父级文件夹 路径即可。如果是 Windows 系统应写成类似 D:/path/to/resources_dir 的格式。

限免游戏资讯订阅默认 08:08:08 发送(如果当天的游戏已经推送过则不产生推送),定义 EPIC_SCHEDULER 环境变量即可指定推送时间,该配置的三个数字依次代表 hour minute second

特别鸣谢

@nonebot/nonebot2 | @Mrs4s/go-cqhttp | @DIYgod/RSSHub | @SD4RK/epicstore_api

作者是 NoneBot2 新手,代码写的较为粗糙,欢迎提出修改意见或加入此插件开发!溜了溜了...

nonebot_plugin_epicfree's People

Contributors

monsterxcn avatar studylessshape avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.