NoneBot 暗语
Project description
📖 介绍
NoneBot2 暗语消息
💿 安装
以下提到的方法任选 其一 即可
[推荐] 使用 nb-cli 安装
在 Bot 的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-argot
使用包管理器安装
pip install nonebot-plugin-argot
# or, use poetry
poetry add nonebot-plugin-argot
# or, use pdm
pdm add nonebot-plugin-argot
⚙️ 配置
配置项 | 必填 | 默认值 |
---|---|---|
argot__url_to_image | 否 | True |
🎉 使用
🏷️ 支持情况
OneBot v11 | OneBot v12 | Kaiheila | Telegram | Feishu | Red | DoDo | Satori | QQ 官方 | Discord |
---|---|---|---|---|---|---|---|---|---|
✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
添加暗语
# 无过期时间
await cmd.send(
"This is a text message. Reply /background to get background image.",
argot={
"name": "background",
"command": "background",
"content": "https://nonebot.dev/logo.png",
}
)
# 60s 后过期
await cmd.send(
"This is a text message. Reply /background to get background image.",
argot={
"name": "background",
"command": "background",
"content": "https://nonebot.dev/logo.png",
"expire": 60
}
)
# 使用 Alconna UniMessage
await (
UniMessage.text("This is a text message. Reply /background to get background image.")
.send(
argot={
"name": "background",
"command": "background",
"content": "https://koishi.chat/logo.png",
"expire": 60
}
)
)
或者使用 add_argot
函数。
参数如下:
name
:名称(相当于content
的 key)content
:暗语内容command
:用户响应指令(为 None 则无法响应)expire
:过期时间(单位:秒;在add_argot
函数中可传入 timedelta)
获取暗语信息
- 使用设置的
command
- 通过
get_argot
函数 - 超管回复暗语消息
/argot [name]
📸 效果图
💖 鸣谢
KiramiBot
:灵感来源
📄 许可证
本项目使用 MIT 许可证开源
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
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_argot-0.1.5.tar.gz
.
File metadata
- Download URL: nonebot_plugin_argot-0.1.5.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 588ba87aa55ef8116d2f6f468702b33eee5096d036aab053aa96126aab9f83dc |
|
MD5 | 8741cb3380070384d82e4ff08a5fdc30 |
|
BLAKE2b-256 | 7a350388855b98726c7a75c759a81cf64645b3b16f43ed8fe1a5c85c5bbadd23 |
File details
Details for the file nonebot_plugin_argot-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: nonebot_plugin_argot-0.1.5-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c23fbe965134086e58dd210548ada179bc859f5adead487ad05746f37b039620 |
|
MD5 | e770a0662def242bf2b81676e0fe00cb |
|
BLAKE2b-256 | f46628ff8d603829dff7c870106e70ed9b06844d5afe678b976636007778d456 |