Skip to main content

nonebot

🔥 nonebot_plugin_firexN

✨ 定时发送QQ消息插件 ✨

license pypi python


插件描述

一款基于Nonebot2的插件

避免尴尬,从我做起,一起燚xN吧

定时早晚各发一条信息(以防早上忘记回复,晚上还有第二次提醒),默认调用API随机发送一句,也可以自定义发送消息的内容及时间。当然如果你愿意花一些心思去读代码,此插件还可以改成你需要的定时提醒工具(再加几个定时器,喝水小助手不就有了么!)

本人未系统学习过py,靠仅有的cpp和py的一点点理解制作的,如果有任何问题、建议,欢迎issues

依赖

本插件依赖定时任务,首先确保自己有nonebot_plugin_apscheduler(pip list查看),安装命令

pip install nonebot_plugin_apscheduler

安装

pip install nonebot_plugin_firexN

配置项

bot.py中添加

nonebot.load_plugin("nonebot_plugin_firexN")

.evn中配置参数说明

fire_users = ["xxx","xxx"]    # 必填 联系人QQ
fire_switch_morning = False   # 选填 True/False 默认开启 早上消息推送是否开启
fire_switch_night = False     # 选填 True/False 默认开启 晚上消息推送是否开启
fire_mode = 1                 # 选填 默认模式2 模式1发送自定义句子,模式2随机调用一句
fire_sentence_moring = ["句子1","句子2","..."]    # 如果是模式1 此项必填,早上随机发送该字段中的一句
fire_sentence_night = ["句子1","句子2","..."]     # 如果是模式1 此项必填,晚上随机发送该字段中的一句
fire_time_moring = "8 0"    # 选填 早上发送时间默认为7:00
fire_time_night = "23 0"    # 选填 晚上发送时间默认为22:00                   

配置示例

模式1

fire_users = ["1310446718","2689438597"]    # 必填 联系人QQ
fire_switch_morning = True    # 选填 True/False 默认开启 早上消息推送是否开启
fire_switch_night = False     # 选填 True/False 默认开启 晚上消息推送是否开启
fire_mode = 1                 # 选填 默认模式2 模式1发送自定义句子,模式2随机调用一句
fire_sentence_moring = ["🌞早,又是元气满满的一天","句子2","..."]    # 如果是模式1 此项必填,早上随机发送该字段中的一句
fire_sentence_night = ["🌛今天续火花了么,晚安啦","句子2","..."]     # 如果是模式1 此项必填,晚上随机发送该字段中的一句
fire_time_moring = "8 0"    # 选填 早上发送时间默认为7:00
fire_time_night = "23 0"    # 选填 晚上发送时间默认为22:00 

模式2

fire_users = ["xxx","xxx"]    # 必填 联系人QQ
fire_mode = 2                 # 必填 模式1发送自定义句子,模式2随机调用一句  

补充

本插件的初衷是续火花而不是群聊定时推送,所以pip安装并没有群聊功能,如果需要你可以将仓库中group_msg.py,保存到在[nb根目录]/plugins/group/group_msg.py中 在.evn中配置参数,之后重启bot.py。

send_group_id = ["xxx","xxx"]    # 必填 群号
send_switch_morning = False      # 选填 True/False 默认开启 早上消息推送是否开启
send_switch_night = False        # 选填 True/False 默认开启 晚上消息推送是否开启
send_mode = 1                 # 选填 默认模式2 模式1发送自定义句子,模式2随机调用一句
send_sentence_moring = ["句子1","句子2","..."]    # 如果是模式1 此项必填,早上随机发送该字段中的一句
send_sentence_night = ["句子1","句子2","..."]     # 如果是模式1 此项必填,晚上随机发送该字段中的一句
send_time_moring = "8 0"    # 选填 早上发送时间默认为7:00
send_time_night = "23 0"    # 选填 晚上发送时间默认为22:00                   

因此功能不属于本插件,另外推荐一款群管插件yzyyz1387/nonebot_plugin_admin,群聊定时推送功能已向作者提交合并申请。

更新记录

2022.8.15,新增消息推送开关,更改fire_mode为选填,默认模式2

fire_switch_morning = True    # 选填 True/False 默认开启 早上消息推送是否开启
fire_switch_night = False     # 选填 True/False 默认开启 晚上消息推送是否开启
fire_mode = 1                 # 选填 默认模式2 模式1发送自定义句子,模式2随机调用一句

Release files for nonebot-plugin-firexN 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-firexN 0.1.7
File Size Uploaded
nonebot_plugin_firexN-0.1.7.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-firexN 0.1.7
File Interpreter ABI Platform
nonebot_plugin_firexN-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 12.4 kB

Release files / nonebot_plugin_firexN-0.1.7.tar.gz

Download URL nonebot_plugin_firexN-0.1.7.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2f3baa67bd60f933d05c5ff11672b7c93b8e6864f01d4ae7fd79f811b258f41e
BLAKE2b-256 checksum
How to use checksums
2a56b348a78790a44709bde93f0b668c545e717b51c7af63b59263b34ee43476
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.10

Release files / nonebot_plugin_firexN-0.1.7-py3-none-any.whl

Download URL nonebot_plugin_firexN-0.1.7-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b08e5b7b3d206cc4aee0cecf0dd8a1797f013c560b3fd816af3b2d40fef390c
BLAKE2b-256 checksum
How to use checksums
483887eb5fbd4f1cab3cbe1d6813389c97fdff7540c287a41403aca7f0752816
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.10

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

2 release files

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page