Skip to main content

nonebot-plugin-partner-join

✨ NoneBot2 插件 用于生成舞萌DX(maimaiDX)旅行伙伴加入图片(旋转gif) 也可用于类似嵌入相应圆形框架图片生成(如将图片嵌入校徽)✨

python

📖 介绍

nonebot-plugin-partner-join 是用于生成舞萌DX(maimaiDX)旅行伙伴加入图片(旋转gif)的插件 也可用于类似嵌入相应圆形框架图片生成(如将图片嵌入校徽)

实现原理

将用户发送的图片裁剪成圆形后嵌入背景gif的透明圆形区域

实现功能

  • 生成"旅行伙伴加入"旋转gif
  • 生成"旅行伙伴加入"静态图片
  • 自定义加入指令
  • 自定义命令参数
  • 自定义生成gif的各项参数
  • 自定义图片加入的背景框
  • 实现旋转gif的顺滑过渡
  • 添加设置是否默认生成旋转gif

注意事项

如果需要增加自定义的背景图,请保证图片满足以下要求,将背景图放入background文件夹中,并在.env文件中按要求添加BACKGROUND_PARAMS配置

  • 背景图片格式为.gif(可以直接通过修改文件名修改.png文件后缀为.gif)
  • 背景图需要有圆形透明区域,需保证透明圆形区域圆心位于图片中轴线(纵向)

💿 安装

使用包管理器安装 下载文件,将nonebot_plugin_partner_join文件夹放入您的nonebot2插件目录内(通常在 : 您的插件根目录\src\plugin)
使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-partner-join
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-partner-join

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

plugins = ["nonebot_plugin_partner_join"]

⚙️ 配置

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

配置项 必填 默认值 说明
JOIN_COMMANDS 否 {"加入": ["join", "旅行伙伴加入"]} 加入指令,可自定义添加别名
STATIC_IMAGE 否 True False则默认生成旋转gif
PARAMS 否 {"skip_gif": ["-s", "s", "stop"], "rotate_img": ["-r", "r", "rotate"]} 当 static_image=True 时,使用 rotate_img 参数生成gif;当 static_image=False 时,使用 skip_gif 参数跳过gif
SELF_PARAMS 否 {"self_join": ["自己", "me", "我"]} 加入自己(头像图片)的指令
BACKGROUND_PARAMS 否 {"background.gif": ["default"], "your_background_name.gif": ["指令1", "指令2"]} 自定义将图片加入其他背景框的参数指令
GIF_FPS 否 30 gif的fps
TOTAL_DURATION 否 2 gif的播放时间
MAX_TURNS 否 4 gif的旋转圈数
ROTATION_DIRECTION 否 -1 gif的旋转方向(1 表示顺时针, -1 表示逆时针)

🎉 使用

使用 加入帮助/join help 指令获取指令表

指令表

加入指令 范围 说明
加入/join/旅行伙伴加入 群聊 生成"旅行伙伴加入"旋转gif
加入+设置的加入其他背景框的指令 群聊 换成你选择的背景框 如:加入XX
指令使用 范围 说明
<加入指令>image 群聊 加入指令与图片一起发送
<加入指令>,image 群聊 先发送加入指令再选择图片发送
<加入指令>"image" 群聊 加入你引用的聊天记录(图片)
<加入指令>@XX 群聊 加入@对象(头像图片)
指令参数 范围 说明
-s/s/stop 群聊 生成静态图片
我/me/自己 群聊 加入自己(头像图片)

效果图

展开

image image image image image

Metadata

Release files for nonebot-plugin-partner-join 0.1.4

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-partner-join 0.1.4
File Size Uploaded Provenance Actions
nonebot_plugin_partner_join-0.1.4.tar.gz 688.2 kB Without provenance Details for nonebot_plugin_partner_join-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-partner-join 0.1.4
File Interpreter ABI Platform Actions
nonebot_plugin_partner_join-0.1.4-py3-none-any.whl Python 3 none any Details for nonebot_plugin_partner_join-0.1.4-py3-none-any.whl

Total release size: 1.4 MB

Release files / nonebot_plugin_partner_join-0.1.4.tar.gz

Download URL nonebot_plugin_partner_join-0.1.4.tar.gz
Size 688.2 kB
Tags Source
SHA-256 checksum
How to use checksums
77d7e790ed2be18bae048006462aab1fbb9ad9afea629573dfb91f4cb10de319
BLAKE2b-256 checksum
How to use checksums
162c8d86c218195f667bdc09ee493b4d6fc963dbb959ac8a5d1bfc292b324b0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.9

Release files / nonebot_plugin_partner_join-0.1.4-py3-none-any.whl

Download URL nonebot_plugin_partner_join-0.1.4-py3-none-any.whl
Size 685.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e2c68a6cd098f25d30ad32fd27468d10028f6364db8edbf04d6f1f083b629e99
BLAKE2b-256 checksum
How to use checksums
04a1bbf8836fabf419f1d9ea5bebc046d1fcf13668f3a53694b1f21bb979c3b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.9

Security for nonebot-plugin-partner-join 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files No provenance

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