新增IRC协议相关的全套工具模块,包括: - 核心协议解析与CTCP处理 - 消息发送缓存与文本 sanitize - 账号配置管理与运行时状态 - 命令处理与权限控制 - 服务发现与诊断工具 - 多账号网关与配置加载
38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from .setup import (
|
|
prepare_setup_wizard,
|
|
run_setup_wizard,
|
|
validate_config,
|
|
)
|
|
|
|
SETUP_ENTRY = {
|
|
"channel_id": "irc",
|
|
"label": "IRC",
|
|
"description": "IRC (Internet Relay Chat) 渠道设置向导",
|
|
"steps": [
|
|
{"id": "server", "label": "服务器配置", "fields": ["server", "port", "use_tls"]},
|
|
{"id": "nickname", "label": "昵称设置", "fields": ["nick", "username", "realname"]},
|
|
{"id": "channels", "label": "频道配置", "fields": ["auto_join_channels"]},
|
|
{"id": "groupAccess", "label": "群组访问控制", "fields": ["group_policy", "groupAllowFrom"]},
|
|
{
|
|
"id": "authentication",
|
|
"label": "认证设置",
|
|
"fields": ["password", "use_sasl", "sasl_username", "sasl_password", "nickserv_password"],
|
|
},
|
|
],
|
|
"prepare": prepare_setup_wizard,
|
|
"run": run_setup_wizard,
|
|
"validate": validate_config,
|
|
}
|
|
|
|
|
|
def get_setup_entry() -> dict[str, Any]:
|
|
return SETUP_ENTRY
|
|
|
|
|
|
def register_bundled_channel_setup() -> dict[str, Any]:
|
|
return SETUP_ENTRY
|