Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

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

License

Notifications You must be signed in to change notification settings

NCBM/nonebot-plugin-extrautils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

本仓库已暂停维护

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-extrautils

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

license pypi python

📖 介绍

本插件集成了一些便于开发 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 -
ob11.universal get_avatar_bytes 下载指定 QQ 用户头像 -
ob11.universal get_self_name 获取机器人自身所在会话的昵称 优先级:群名片>用户昵称
ob11.universal get_user_name 获取指定 QQ 用户所在会话的昵称 优先级:群名片>用户昵称
ob11.universal get_user_name_bare 获取指定 QQ 用户昵称 有未封装版本
ob11.universal get_user_name_group 获取指定 QQ 用户群昵称 有未封装版本
ob11.gocq Node 构造适用于 go-cqhttp 的简单自定义消息节点 -
ob11.gocq msg2node_self 转化多条消息到发送者为自身的消息节点 -
ob11.gocq msg2node_custom 转化多条消息到发送者为指定用户的消息节点 -
ob11.gocq send_forward_msg 发送合并转发消息 发送者为机器人自身
ob11.gocq send_forward_msg_custom 发送合并转发消息 允许自定义发送者信息, 有未封装版本
misc TmpFile 临时文件封装 支持 Context manager

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages