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.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for nonebot-plugin-extrautils-0.1.2.tar.gz
Algorithm Hash digest
SHA256 98fe347834da51b4bcab5daecc23c43cb9e8aba72d430f08079ce3853ca53022
MD5 60b4d1e9323d1ff9c943b038d64ef508
BLAKE2b-256 c930923f51a7ab3d303caf7910004f94ead28623b1339ae9f73601535445f070

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_extrautils-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 89896f3d29905855668e67220ff9095641176c6f6f177fb2f4db34867ac886cf
MD5 a30262eca5c505497ac42d71a5bc5b47
BLAKE2b-256 9d6b3c4680bcbce82ff95d93bf09b56651e88a6f081e620a9864b78be5663d1b

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