Skip to main content

Nonebot2 简易插件随个人,随个群友当幸运观众🤪

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-person

✨ Nonebot2 简易插件随个人,随个群友当幸运观众🤪 ✨

license pypi python

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-person
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-person
pdm
pdm add nonebot-plugin-person
poetry
poetry add nonebot-plugin-person
conda
conda install nonebot-plugin-person

打开 nonebot2 项目的 bot.py 文件, 在其中写入

nonebot.load_plugin('nonebot-plugin-person')
从 github 安装 在 nonebot2 项目的插件目录下, 打开命令行, 输入以下命令克隆此储存库
git clone https://github.com/jcjrobert/nonebot-plugin-person.git

打开 nonebot2 项目的 bot.py 文件, 在其中写入

nonebot.load_plugin('src.plugins.nonebot-plugin-person')

⚙️ 配置

可在 nonebot2 项目的.env文件中添加下表中的配置

配置项 必填 默认值 说明
person_show_avatar true 是否显示头像,默认显示
person_extra_messages [] 自定义文案,{name}会替换成Bot昵称,{person}会替换成抽到的人的信息,没有这两项依然能展示
person_extra_messages_overwrite false 自定义文案是否覆盖已有文案,默认不覆盖
person_at false 是否at随人对象,将会替换QQ号放在消息结尾
person_choose_last false 是否仅抽取最近发言的群友,默认否
person_choose_last_time 2592000 最近发言时间范围,默认为2592000(30天)
person_check_last false 日志打印,用于检查群友最近发言时间

注意,不要将最近发言时间范围设置的太短,因为API获取到的最近发言时间戳经测试并不同步,如果有更好的方案欢迎提出issue或pr

🎉 使用

随个人

随个人帮我打代码

随个人XXX

...

📝 更新日志

展开/收起

0.0.5

  • 支持仅抽取最近发言的群友

0.0.4

  • 修复机器人昵称配置为空时报错的BUG

0.0.3

  • 支持AT随人对象

0.0.2

  • 支持头像显示
  • 支持自定义文案,同时支持是否覆盖原文案

0.0.1

  • 插件初次发布

开源许可

本项目使用MIT许可证开源

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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-person-0.0.5.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

nonebot_plugin_person-0.0.5-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file nonebot-plugin-person-0.0.5.tar.gz.

File metadata

  • Download URL: nonebot-plugin-person-0.0.5.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for nonebot-plugin-person-0.0.5.tar.gz
Algorithm Hash digest
SHA256 207e209df98f964824574b9a45ea87af811c562426fa10e401fc4e3267be5a0a
MD5 439fa53f7782c17f54fe775bd9aa4687
BLAKE2b-256 a6fa8a8ccea095f46862732c8eb0a7a96dc4f824b4e81c57f4950ea449e22c68

See more details on using hashes here.

File details

Details for the file nonebot_plugin_person-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_person-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 178d6941447d67844d6db9a590d8c72cb02b7fef407a53d513c96b8f7a088ac5
MD5 c5122fa7249499037de0cc409596ccf9
BLAKE2b-256 6f547460c6b516c53ae023549ab42ec3c73340825646df1e9b06e89e2b92639e

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