Skip to content

开始使用

Ailitonia edited this page Jun 8, 2024 · 5 revisions

配置并启动协议端

sqlite 数据库 + OneBot V11 协议端为例, 使用 Lagrange 作为协议端

启动 omega-miya

python bot.py

正常运行后 omega-miya 所在的控制台会输出如下日志:

06-09 02:13:38 [SUCCESS] nonebot | NoneBot is initializing...
06-09 02:13:38 [INFO] nonebot | Current Env: sample
06-09 02:13:39 [INFO] src | Database | 已配置 sqlite 数据库连接
06-09 02:13:39 [INFO] gocqhttp_guild_patch | Guild patch(go-cqhttp) loaded
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "omega_multibot_support" from "src.service.omega_multibot_support"
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "omega_requests" from "src.service.omega_requests"
06-09 02:13:40 [INFO] gocqhttp_self_sent_patch | MessageSent patch(go-cqhttp) loaded
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "gocqhttp_self_sent_patch" from "src.service.gocqhttp_self_sent_patch"
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "omega_api" from "src.service.omega_api"
06-09 02:13:40 [INFO] gocqhttp_addition_event_patch | Addition event patch(go-cqhttp) loaded
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "gocqhttp_addition_event_patch" from "src.service.gocqhttp_addition_event_patch"
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "omega_processor" from "src.service.omega_processor"
06-09 02:13:40 [INFO] qq_guild_audit_patch | QQ GuildAudit patch loaded
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "qq_guild_audit_patch" from "src.service.qq_guild_audit_patch"
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "gocqhttp_guild_patch" from "src.service.gocqhttp_guild_patch"
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "omega_base" from "src.service.omega_base"
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "apscheduler" from "src.service.apscheduler"
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "onebot_v11_anti_recall" from "src.plugins.onebot_v11_anti_recall"
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "choice_helper" from "src.plugins.choice_helper"
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "omega_email" from "src.plugins.omega_email"
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "nbnhhsh" from "src.plugins.nbnhhsh"
06-09 02:13:40 [SUCCESS] nonebot | Succeeded to load plugin "roll" from "src.plugins.roll"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "bilibili_account_manager" from "src.plugins.bilibili_account_manager"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "omega_scheduled_message" from "src.plugins.omega_scheduled_message"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "omega_statistic" from "src.plugins.omega_statistic"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "onebot_v11_group_welcome_message" from "src.plugins.onebot_v11_group_welcome_message"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "onebot_v11_self_mute" from "src.plugins.onebot_v11_self_mute"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "bot_message_revoker" from "src.plugins.bot_message_revoker"
06-09 02:13:41 [WARNING] src | Pixiv | 未配置 Pixiv Cookie, 部分功能可能无法正常使用
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "moe" from "src.plugins.moe"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "omega_core_manager" from "src.plugins.omega_core_manager"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "omega_announcement" from "src.plugins.omega_announcement"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "pixivsion" from "src.plugins.pixivsion"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "mirage_tank" from "src.plugins.mirage_tank"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "bilibili_dynamic_monitor" from "src.plugins.bilibili_dynamic_monitor"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "pixiv" from "src.plugins.pixiv"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "tarot" from "src.plugins.tarot"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "shindan_maker" from "src.plugins.shindan_maker"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "http_cat" from "src.plugins.http_cat"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "nhentai" from "src.plugins.nhentai"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "what_to_eat" from "src.plugins.what_to_eat"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "onebot_v11_group_repeater" from "src.plugins.onebot_v11_group_repeater"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "onebot_v11_invite_request_manager" from "src.plugins.onebot_v11_invite_request_manager"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "onebot_v11_auto_group_sign" from "src.plugins.onebot_v11_auto_group_sign"
06-09 02:13:41 [WARNING] src | Tencent Cloud | 未配置腾讯云 API Key, 部分功能可能无法正常使用
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "translate" from "src.plugins.translate"
06-09 02:13:41 [WARNING] src | ImageSearcher | 未配置 Saucenao API KEY, 部分识图功能可能无法正常使用
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "image_searcher" from "src.plugins.image_searcher"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "bilibili_live_monitor" from "src.plugins.bilibili_live_monitor"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "omega_sign_in" from "src.plugins.omega_sign_in"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "maybe" from "src.plugins.maybe"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "sticker_maker" from "src.plugins.sticker_maker"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "onebot_v11_zhoushen_hime" from "src.plugins.onebot_v11_zhoushen_hime"
06-09 02:13:41 [SUCCESS] nonebot | Succeeded to load plugin "weibo_monitor" from "src.plugins.weibo_monitor"
06-09 02:13:41 [SUCCESS] nonebot | Running NoneBot...
06-09 02:13:41 [INFO] uvicorn | Started server process [24020]
06-09 02:13:41 [INFO] uvicorn | Waiting for application startup.
06-09 02:13:41 [INFO] apscheduler | Scheduler Started
06-09 02:13:41 [INFO] src | Database | 正在初始化数据库
06-09 02:13:41 [SUCCESS] src | Database | 数据库初始化已完成
06-09 02:13:42 [SUCCESS] omega_processor | Plugin Manager | 插件信息初始化已完成.
06-09 02:13:42 [WARNING] src | Bilibili | Cookie 验证失败, 登录状态异常, 账号未登录
06-09 02:13:42 [WARNING] src | Bilibili | 用户 Cookies 未配置或验证失败, 部分功能可能不可用
06-09 02:13:42 [ERROR] src | Bilibili | 用户 Cookies 刷新失败, 请尝试重新登录, Invalid variable type: value should be str, int or float, got None of type <class 'NoneType'>
06-09 02:13:42 [INFO] bilibili_live_monitor | BilibiliLiveRoomMonitor | Initializing live room status
06-09 02:13:42 [SUCCESS] bilibili_live_monitor | BilibiliLiveRoomMonitor | Live room status initializing completed
06-09 02:13:42 [INFO] uvicorn | Application startup complete.
06-09 02:13:42 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:3322 (Press CTRL+C to quit)

协议端成功连接后 omega-miya 所在的控制台会输出如下日志:

06-09 02:16:50 [INFO] uvicorn | ('127.0.0.1', 59278) - "WebSocket /onebot/v11/ws" [accepted]
06-09 02:16:50 [INFO] nonebot | OneBot V11 | Bot 123456789 connected
06-09 02:16:50 [INFO] websockets | connection open
06-09 02:16:50 [SUCCESS] nonebot | OneBot V11 123456789 | [bot_action]: Bot(OneBot V11/123456789) occurred the action: BOT_CONNECT
06-09 02:16:50 [SUCCESS] omega_multibot_support | OneBot V11: 123456789 已连接, Bot status upgraded Success
06-09 02:16:50 [WARNING] omega_multibot_support | OneBot V11: 123456789, Upgrade guild/channel data failed, guild api not supported, ActionFailed(status='failed', retcode=404, data=None, echo='4')
06-09 02:16:50 [SUCCESS] omega_multibot_support | OneBot V11: 123456789 已连接, All entity data upgraded Success

这表示协议端已经成功地连接上了 omega-miya

第一次对话

现在,尝试向机器人账号发送如下内容:

/omega

到这里如果一切 OK,机器人应该会给你回复

Hello World

现在可以开始使用了!