Skip to main content

不要复读

Project description

nonebot_plugin_no_repeat 不要复读

防止代码炸了在群里复读刷屏,让你写插件的时候更安全

配置(可选)

名称 意义 默认值/推荐值
no_repeat_mode use, not_use 白名单模式(use) or 黑名单模式(not_use) not_use
no_repeat_groups [12345, 23456] 群聊号 []
no_repeat_threshold 3 发送重复语句达到3条后视为复读(第三条会被阻止发送) 3
no_repeat_gap 20 与上一条语句的发送间隔超过20s则不视为复读 20

白名单模式:仅在指定群内开启该功能

黑名单模式:仅在指定群内关闭该功能(比如你的机器人专用调试群),其他群均开启该功能

实现原理

https://v2.nonebot.dev/docs/next/advanced/runtime-hook#bot-api-%E8%B0%83%E7%94%A8%E9%92%A9%E5%AD%90

检测到异常复读情况后抛出MockApiException

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_no_repeat-0.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

nonebot_plugin_no_repeat-0.0.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_no_repeat-0.0.1.tar.gz.

File metadata

  • Download URL: nonebot_plugin_no_repeat-0.0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.8.3 Windows/10

File hashes

Hashes for nonebot_plugin_no_repeat-0.0.1.tar.gz
Algorithm Hash digest
SHA256 853f2b11f599490eb2a39963480a3df86fc76914f2120ed4906e2483f23b628d
MD5 44fa8948c6129a8d0d39837500d771ff
BLAKE2b-256 dbae2e8b7cc19b0f0392fa80942950249561642f78ca5a348034ada570a5d4b0

See more details on using hashes here.

File details

Details for the file nonebot_plugin_no_repeat-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_no_repeat-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd1e2f0fa6776c718c06435ca30552b5527cbb17a81396efa8d6aabbb5a63275
MD5 8972edc69fc71d2f6f26c1104fabf0ae
BLAKE2b-256 f71d20f43b05fc8f5417bb8a6ba0c978f025dfea2a5fed5e119fad08094e1e58

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page