Skip to main content

NoneBot2 头像管理插件,支持机器人与群资料的立即修改和定时修改。

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-avatar-manager

✨ NoneBot2 头像管理插件,支持机器人和群资料的立即修改与定时修改 ✨

license pypi python

📖 介绍

nonebot-plugin-avatar-manager 是一个基于 NoneBot2 和 OneBot V11 的资料管理插件,提供机器人头像/昵称、群头像/群名称的立即修改和定时修改能力,并支持任务持久化恢复。

插件目前支持的核心场景:

  • 超级管理员在私聊中查看机器人信息和可管理群列表
  • 群主或管理员在群聊中直接修改当前群头像或群名称
  • 超级管理员修改机器人自身头像或昵称
  • 为群资料或机器人资料创建定时修改任务
  • 启动时自动恢复已保存任务

💿 安装

使用 nb-cli 安装

在 nonebot2 项目的根目录下打开命令行,输入以下指令即可安装:

nb plugin install nonebot-plugin-avatar-manager
使用包管理器安装

在 nonebot2 项目的插件目录下打开命令行,根据你使用的包管理器,输入相应的安装命令。

pip
pip install nonebot-plugin-avatar-manager

安装完成后,打开 nonebot2 项目根目录下的 pyproject.toml 文件,在 [tool.nonebot] 部分追加写入:

plugins = ["nonebot_plugin_avatar_manager"]

⚙️ 配置

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

配置项 必填 默认值 说明
SUPERUSERS NoneBot 超级管理员账号列表,私聊管理机器人资料时必需
ENABLE_SELF_AVATAR true 是否允许修改机器人自身头像与昵称
ENABLE_GROUP_AVATAR true 是否允许修改群头像与群名称

示例:

SUPERUSERS=["123456789"]
ENABLE_SELF_AVATAR=true
ENABLE_GROUP_AVATAR=true

🎉 使用

指令表

指令 权限 需要@ 范围 说明
头像帮助 超级管理员 / 群管理员 / 群主 私聊 / 群聊 查看插件帮助
头像信息 超级管理员 私聊 查看机器人账号、昵称、头像地址与所在群列表
群管 超级管理员 私聊 查看机器人在哪些群具备管理权限
修改 群管理员 / 群主 群聊 立即修改当前群头像或群名称
定时修改 群管理员 / 群主 群聊 为当前群创建定时修改任务
bot修改 超级管理员 私聊 / 群聊 立即修改机器人头像或昵称
bot定时修改 超级管理员 私聊 / 群聊 为机器人自身创建定时修改任务
定时列表 超级管理员 / 群管理员 / 群主 私聊 / 群聊 查看任务列表;群聊中只显示当前群任务
删除定时 超级管理员 / 群管理员 / 群主 私聊 / 群聊 删除指定任务;群聊中仅可删除当前群任务

使用示例

修改 https://example.com/avatar.jpg
修改 新群名
修改 https://example.com/avatar.jpg 新群名
定时修改 0 8 * * * https://example.com/avatar.jpg
定时修改 0 8 * * * 新群名
bot修改 https://example.com/avatar.jpg 新昵称
bot定时修改 0 9 * * 1 https://example.com/avatar.jpg
删除定时 avatar_group_20260409100000

Cron 示例

0 8 * * *    每天 8 点执行
0 9 * * 1    每周一 9 点执行
*/30 * * * * 每 30 分钟执行一次

任务存储

  • data/avatar_manager/tasks.json:保存定时任务
  • data/avatar_manager/temp:保存下载的临时图片

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_avatar_manager-0.1.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_avatar_manager-0.1.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_avatar_manager-0.1.0.tar.gz.

File metadata

  • Download URL: nonebot_plugin_avatar_manager-0.1.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.26.7 CPython/3.12.3 Linux/6.17.0-1008-azure

File hashes

Hashes for nonebot_plugin_avatar_manager-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bb7b0eac0631895f52713b318f2cc47a8d91c1fab1c9e6784373314f923bb0b3
MD5 df5debbb9e992e59e47c10739868844a
BLAKE2b-256 bd83f596dafa564f07fe8405081e36aec007d72ee2a0551acdc8ec91198b1709

See more details on using hashes here.

File details

Details for the file nonebot_plugin_avatar_manager-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_avatar_manager-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7b105206474e061f4bc64020c5ba21f2aa450bc7d5a8011aad52d3d17a40da0
MD5 805beb368b3324e2471b04fa91fd2633
BLAKE2b-256 845fcacba582efec9d57886573eb1b2f0bc592127d943285924e929c5766c2b5

See more details on using hashes here.

Supported by

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