Code Monkey home page Code Monkey logo

nonebot_plugin_reminder's Introduction

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-reminder

✨ NoneBot 插件简单描述 ✨

license pypi python

这是一个 nonebot2 插件库, 主要用来提醒大家别忘记什么事情,可以看成定时提醒插件, 依赖于nonebot-plugin-send-anything-anywhere,理论上支持大部分平台,但目前只测试过onebot.v11。

指令

定时 [date]→ 设置定时提醒,date为时间,格式为HH:MM,如 23:59, 不设置默认为17点 定时请求[date]→ 设置定时请求某个URL,返回其内容,目前只能请求图片,date为时间,格式为HH:MM,如 23:59, 不设置默认为17点 定时列表 → 列出所有定时提醒 清空|清除定时 → 清空所有定时提醒 开启|关闭|查看|删除|执行定时提醒 [id] → 开启|关闭|查看|删除|执行指定id的定时提醒 修改|更新定时 [id] → 修改指定id的定时提醒

  • 定时提醒: 在默认时间定时提醒

    • 定时提醒 [时间]: 在指定时间定时提醒

      时间格式为 HH:MM , 例如 17:00

    之后 Bot 会询问提醒的时间间隔

    1.每天 回复1

    2.某天回复具体日期,格式为yyyy-mm-dd,如2023-01-03

    3.工作日 回复3

    回复数字即可

    再之后 Bot 会询问需要提醒的内容 默认为 打卡!!, 回复0即使默认内容

  • 定时请求:与上面用法类似

  • 定时列表 [page]: 列出设置的所有定时任务

  • 清空/清除定时 : 清除的所有定时任务

  • 查看/删除/开启/关闭/执行定时 [id] : 查看/删除/开启/关闭指定id的定时任务

  • 定时请求: 定时请求数据,目前支持图片

  • 定时jobs [page]: 列出底层任务情况(debug使用)

  • 备份定时/定时备份: 备份所有定时任务

  • 备份列表: 列出备份的文件名,用于还原时候指定文件

  • 备份恢复|恢复备份|还原备份|备份还原|使用备份|备份使用 [备份文件名]: 使用指定的文件还原定时任务

  • 查看备份 [备份文件名]: 以友好的列表的形式展示备份的内容

配置项

配置方式:直接在 NoneBot 全局配置文件中添加以下配置项即可。

NoneBot 配置相关教程详见 配置 | NoneBot

如果需要持久化定时任务(即nonebot2重启后任务还在),需要配置 nonebot-plugin-apscheduler 插件。

.env中加上 apscheduler_config={ "apscheduler.timezone": "Asia/Shanghai", "apscheduler.jobstores.default":{"type":"sqlalchemy","url":"sqlite:///jobs.sqlite"} }

进入到nonebot的安装目录,执行source .venv/bin/activate,进入虚拟环境

执行pip install sqlalchemy安装sqlalchemy。(不知道为什么nonebot-plugin-apscheduler 插件没有包含这个库) 重启nonebot2,即可持久化定时任务。

现在不需要配置nonebot-plugin-apscheduler插件的持久化了,插件已经实现了。

reminder_default_hour

  • 类型: int
  • 默认: 17
REMINDER_DEFAULT_HOUR=17

reminder_default_minute

  • 类型: int
  • 默认: 0
REMINDER_DEFAULT_MINUTE=0

reminder_id_len

  • 类型: int
  • 说明:底层任务id长度
  • 默认: 5
REMINDER_ID_LEN=5

reminder_id_prefix

  • 类型: str
  • 说明:底层任务id的前缀
  • 默认: 0
REMINDER_ID_PREFIX=reminder

reminder_page_size

  • 类型: str
  • 说明:列出任务时,每次列出的条目数
  • 默认: 0
REMINDER_PAGE_SIZE=5

reminder_bk_size

  • 类型: str
  • 说明:最多有几个备份
  • 默认: 0
REMINDER_BK__SIZE=5

依赖

致谢

代码基于 nonebot-plugin-everyday-en,感谢原作者的开源精神!

其他

修改定时的时候,私聊对象和群组只能二选一。

开源许可

  • 本插件使用 MIT 许可证开源

nonebot_plugin_reminder's People

Contributors

velor2012 avatar

Stargazers

 avatar

Watchers

 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.