Skip to main content

Extra utility functions for easier development with nonebot2

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-extrautils

✨ Extra utility functions for easier development with nonebot2. 方便开发的更多小功能。 ✨

license pypi python

📖 介绍

本插件集成了一些便于开发的小功能。

💿 安装

使用 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

nonebot-plugin-extrautils-0.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file nonebot-plugin-extrautils-0.1.1.tar.gz.

File metadata

File hashes

Hashes for nonebot-plugin-extrautils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b403228c1fc78178c010ad7d6592fab0df53f80b2e51aa0997d7d6d82fdce5c4
MD5 32a98a6df5c82b93b0a3d093336da97d
BLAKE2b-256 3cdb0c1c8d9852cc98a0d659e565c4fb191b0466c625c302f6b8efaaefa8eb16

See more details on using hashes here.

File details

Details for the file nonebot_plugin_extrautils-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_extrautils-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 379b6a599566ae727be355606d59447424a02d7b18255421f76c614056ffe94f
MD5 f2f1bd53f407b07932b924001f8021dc
BLAKE2b-256 c64587ad6d69387339bc979f7436faf94665a51d060c3997266d7d7731dde869

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