Nonebot2 Support for LiteyukiBot
Project description
📖 介绍
一个简单的 liteyukibot 插件,可以为你的机器人提供 NoneBot 支持,有一定NoneBot基础即可从原有的NoneBot迁移到轻雪
💿 安装
使用 pip 安装
在 轻雪 项目的根目录下打开命令行, 输入以下指令即可安装pip install liteyukibot-plugin-nonebot
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令pip
pip install liteyukibot-plugin-nonebot
pdm
pdm add liteyukibot-plugin-nonebot
poetry
poetry add liteyukibot-plugin-nonebot
conda
conda install liteyukibot-plugin-nonebot
🎉 使用
仅运行此插件(开发测试)
运行入口文件
python main.py
或自行通过开发工具运行
from liteyuki.dev.plugin import run_plugins
if __name__ == "__main__":
run_plugins("liteyukibot_plugin_nonebot")
装载到机器人程式运行(生产环境)
在轻雪配置文件中添加如下结构配置其一,使轻雪知晓应加载此插件
扁平化配置项(推荐在少量配置时使用)
liteyuki.plugins: [ ..., "liteyukibot_plugin_nonebot" ]
普通配置项(在主要配置文件中使用)
liteyuki:
plugins:
...
- liteyukibot_plugin_nonebot
此插件默认装载nonebot-adapter-onebot
适配器和fastapi
,httpx
及websockets
三个常用驱动器,可根据需求进行配置或二次分发使用
安装其他NoneBot商店推荐使用轻雪的NoneBot插件npm
⚙️ 配置
参考LiteyukiBot的配置文档,在config下新建配置文件nonebot.yml/toml/json
(你可自行命名),填入如下结构配置文件,这里使用yaml
nonebot:
host: 127.0.0.1 # 监听地址,外部访问请设置为0.0.0.0
port: 8080 # 自定义端口
command_start: [ "", "/" ] # 命令前缀
superusers: [ "0000" ] # 你的用户id
nickname: [ "liteyuki" ] # 你的机器人昵称
liteyuki:
reload: true # 轻雪开发模式 运行时重载 启用后修改nonebot插件后可重载插件
ℹ️ 其他
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 liteyukibot_plugin_nonebot-0.1.3.tar.gz
.
File metadata
- Download URL: liteyukibot_plugin_nonebot-0.1.3.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.18.1 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5dd7ea783d7ffdb161c6e766e67964963e2e1ed15d74a4f78c432630946e2a7 |
|
MD5 | 304df03fb00948164f5b64ed81a76a5f |
|
BLAKE2b-256 | 0712cbe932b2dc876fbb0000d4164fcfe94c6c983cb518f916ec9bbad8cb73fc |
File details
Details for the file liteyukibot_plugin_nonebot-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: liteyukibot_plugin_nonebot-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.18.1 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eced9192e4763424d3c4eef3a562e9a1a14184f8b7a4492afd706fcd8bdca550 |
|
MD5 | 1a37a4d0d4db2bd6112b4b00e3523155 |
|
BLAKE2b-256 | 54fd6da7522bfcd65690b675a79267cc2dd3497854eb449a410b5ee36aa9af78 |