MiraiForum

    • 注册
    • 登录
    • 搜索
    • 热门
    • 最新
    • 未解决
    • 标签
    • 群组
    • 友情链接
    1. 主页
    2. bny-alter
    B
    • 资料
    • 关注 0
    • 粉丝 0
    • 主题 1
    • 帖子 3
    • 最佳 0
    • 有争议的 0
    • 群组 0

    bny-alter

    @bny-alter

    0
    声望
    3
    资料浏览
    3
    帖子
    0
    粉丝
    0
    关注
    注册时间 最后登录

    bny-alter 取消关注 关注

    bny-alter 发布的最新帖子

    • RE: nonebot装了adapter之后连不上mirai_api_http,求助

      @Mr-喜 还是谢谢你ღ( ´・ᴗ・` )

      发布在 使用交流
      B
      bny-alter
    • RE: nonebot装了adapter之后连不上mirai_api_http,求助

      @Mr-喜 改成127.0.0.1了,还是不行。之前两边也都试过localhost、127.0.0.1和0.0.0.0,都没成功。
      另外我把mirai-api-http里面的http监听加上去了,about页面可以正常打开,是不是说明我的mirai-api-http服务起得没有问题?

      发布在 使用交流
      B
      bny-alter
    • nonebot装了adapter之后连不上mirai_api_http,求助

      mcl目前配置好了,然后按照https://github.com/ieew/nonebot_adapter_mirai2/wiki上面的教程给两边进行了配置,之后先起mcl再起nb,结果mcl这边可以收到消息,nb那边收不到。
      请求大佬帮忙看下配置和日志,是哪里出了问题?

      mirai-api-http的配置:

      adapters: 
        - ws
      debug: false
      enableVerify: true
      verifyKey: INITKEYgdQ7LPBm
      singleMode: false
      cacheSize: 2048
      adapterSettings:
        ws:
          host: localhost
          port: 5700
      

      nb这边的.env:

      ENVIRONMENT=dev
      VERIFY_KEY=INITKEYgdQ7LPBm
      driver=~fastapi+~websockets
      
      MIRAI_HOST=127.0.0.1
      MIRAI_PORT=5700 
      MIRAI_QQ=["xxxxxxxxxx"]
      SUPERUSERS=[] 
      

      mcl这边api插件的日志:

      2023-11-29 15:17:00 W/mirai-api-http: USING INITIAL KEY, please edit the key
      2023-11-29 15:17:00 I/Mirai HTTP API: ********************************************************
      2023-11-29 15:17:00 I/MahKtorAdapter[ws]: Autoreload is disabled because the development mode is off.
      2023-11-29 15:17:00 I/MahKtorAdapter[ws]: Application started in 0.063 seconds.
      2023-11-29 15:17:00 I/MahKtorAdapter[ws]: Responding at http://localhost:5700
      2023-11-29 15:17:00 I/ws adapter: >>> [ws adapter] is listening at ws://localhost:5700
      2023-11-29 15:17:00 I/Mirai HTTP API: Http api server is running with verifyKey: INITKEYgdQ7LPBm
      2023-11-29 15:17:00 I/Mirai HTTP API: adaptors: [ws]
      2023-11-29 15:17:00 I/Mirai HTTP API: ********************************************************
      

      mcl这边接受消息的日志:

      2023-11-29 15:17:18 I/Bot.xxxxxxxxxx: Saved account secrets to local cache for fast login.
      2023-11-29 15:17:18 I/Bot.xxxxxxxxxx: Login successful.
      2023-11-29 15:17:18 V/Bot.xxxxxxxxxx: Event: BotOnlineEvent(bot=Bot(xxxxxxxxxx))
      2023-11-29 15:17:18 I/Bot.xxxxxxxxxx: Bot login successful.
      xxxx(xxxxxxxxxx) Login successful
      2023-11-29 15:17:30 V/Bot.xxxxxxxxxx: xxxx(xxxxxxxxxx) -> 1
      2023-11-29 15:17:33 V/Bot.xxxxxxxxxx: xxxx(xxxxxxxxxx) -> 121
      

      nb这边的日志:

      11-29 15:17:48 [SUCCESS] nonebot | NoneBot is initializing...
      11-29 15:17:48 [INFO] nonebot | Current Env: dev
      11-29 15:17:48 [DEBUG] nonebot | Loaded Config: {'driver': '~fastapi', 'host': IPv4Address('127.0.0.1'), 'port': 8080, 'log_level': 'DEBUG', 'api_timeout': 30.0, 'superusers': set(), 'nickname': set(), 'command_start': {'/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=120), 'mirai_host': '127.0.0.1', 'mirai_qq': ['xxxxxxxxxx'], 'verify_key': 'INITKEYgdQ7LPBm', 'mirai_port': 5700, 'environment': 'dev'}
      11-29 15:17:48 [DEBUG] nonebot | Succeeded to load adapter "mirai2"
      11-29 15:17:48 [SUCCESS] nonebot | Succeeded to load plugin "test" from "src.plugins.test"
      11-29 15:17:48 [WARNING] __main__ | Always use `nb run` to start the bot instead of manually running!
      11-29 15:17:48 [SUCCESS] nonebot | Running NoneBot...
      11-29 15:17:48 [DEBUG] nonebot | Loaded adapters: mirai2
      11-29 15:17:49 [INFO] uvicorn | Started server process [21180]
      11-29 15:17:49 [INFO] uvicorn | Waiting for application startup.
      11-29 15:17:49 [INFO] uvicorn | Application startup complete.
      11-29 15:17:49 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
      
      发布在 使用交流
      B
      bny-alter