Extra utility functions for easier development with nonebot2
Project description
nonebot-plugin-extrautils
✨ Extra utility functions for easier development with nonebot2. 方便开发的更多小功能。 ✨
📖 介绍
本插件集成了一些便于开发的小功能。
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-extrautils
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令注意:如果机器人在某个虚拟环境中运行,请确保安装前已经进入虚拟环境
pip
pip install nonebot-plugin-extrautils
pdm
pdm add nonebot-plugin-extrautils
poetry
poetry add nonebot-plugin-extrautils
conda
conda install nonebot-plugin-extrautils
然后自行加载本插件
🎉 使用
在插件中导入对应的功能组或函数:
from nonebot_plugin_extrautils.ob11 import universal
# 或者
from nonebot_plugin_extrautils.ob11.gocq import send_forward_msg
然后按需调用即可。
本插件目前不会涉及框架本身功能,不需要通过 nonebot.load_plugin()
或 require()
作为功能插件加载。
功能集
功能组 | 函数 | 说明 | 参数 | 备注 |
---|---|---|---|---|
ob11.universal | get_avatar_url | 获取指定 QQ 用户头像 URL | (uid: int | str, size: int = ...) -> str | - |
ob11.universal | get_avatar_bytes | 下载指定 QQ 用户头像 | [async] (uid: int | str, size: int = ...) -> bytes | - |
ob11.universal | get_user_name | 获取指定 QQ 用户所在会话的昵称 | [async] (*, bot: Bot, event: _UserEvent, no_cache: bool = ...) -> str | 优先级:群名片>用户昵称 |
ob11.universal | get_user_name_bare | 获取指定 QQ 用户昵称 | [async] (*, bot: _OneBotV11Bot, event: _OneBotV11MessageEvent, no_cache: bool = ...) -> str | 有未封装版本 |
ob11.universal | get_user_name_group | 获取指定 QQ 用户群昵称 | [async] (*, bot: _OneBotV11Bot, event: _OneBotV11GroupMessageEvent, no_cache: bool = ...) -> str | 有未封装版本 |
ob11.gocq | send_forward_msg | 发送合并转发消息 | [async] (*, bot: _OneBotV11Bot, event: _OneBotV11MessageEvent, nodes: Sequence[Message | Sequence[dict[str, Any]] | str]) -> dict[str, Any] | 有未封装版本, W.I.P. |
ob11.gocq | send_forward_msg_custom | 发送合并转发消息 | [async] (*, bot: _OneBotV11Bot, event: _OneBotV11MessageEvent, nodes: Sequence[MessageNode | MessageSegment | dict[str, Any]]) -> dict[str, Any] | 允许自定义发送者信息, 有未封装版本, W.I.P. |
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
Built Distribution
File details
Details for the file nonebot-plugin-extrautils-0.1.2.tar.gz
.
File metadata
- Download URL: nonebot-plugin-extrautils-0.1.2.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98fe347834da51b4bcab5daecc23c43cb9e8aba72d430f08079ce3853ca53022 |
|
MD5 | 60b4d1e9323d1ff9c943b038d64ef508 |
|
BLAKE2b-256 | c930923f51a7ab3d303caf7910004f94ead28623b1339ae9f73601535445f070 |
File details
Details for the file nonebot_plugin_extrautils-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: nonebot_plugin_extrautils-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89896f3d29905855668e67220ff9095641176c6f6f177fb2f4db34867ac886cf |
|
MD5 | a30262eca5c505497ac42d71a5bc5b47 |
|
BLAKE2b-256 | 9d6b3c4680bcbce82ff95d93bf09b56651e88a6f081e620a9864b78be5663d1b |