MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    学习群友聊天的机器人XiaoFeimian

    其他项目发布
    8
    12
    1989
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • santsue
      santsue last edited by

      项目地址:https://github.com/DaFeimian/XiaoFeimian

      • Language: Python
      • Implementation: mirai-api-http
      • Base: Http Adapter
      • Tag: 学习别人说话,聊天

      基本说明

      基于Mirai及mirai-api-http制作的QQ学习群友说话机器人。
      灵感来源及基本参考来源于:ChatLearning(Github)

      • 项目命名为:小肥免 (XiaoFeimian),因为之前一直是把这个QQ当机器人用ChatLearning放在我的MC模组交流群里面聊天的,但是昨天不知道为什么我自己用ChatLearning效果一直很怪,于是就花了5个小时沿用了我写的我的世界自主学习机器人模组的原理自己写了一个,因此项目本身比较简单,也没有很完善的对未来拓展功能提前写好底层~

      • 简单原理介绍:监听获取群消息(当然后面也可以做好友消息,但是感觉没那么有意思,就只做了群消息),上一个消息作为问题,下一个消息作为答案来进行记录,只要是相同的问题,答案都重复记录以增加权重(其实可以直接设置一个times但是我好累!),这样就可以进行匹配群友的对话来给出答案回复了~

      ffcd2d1f-0e82-42bb-923f-059adae30769-image.png

      安装

      1. 安装Mirai(Github)
      2. 前往项目地址:https://github.com/DaFeimian/XiaoFeimian Release下载XiaoFeimian.exe程序
      3. 前往mirai-api-http(Github)安装2.10.0版本的的mirai-api-http,高版本可能会有api变动导致小肥免(XiaoFeimian)无法使用。
      4. 设置mirai-api-http的配置文件setting.yml
      5. 把XiaoFeimian.exe程序放在你容易找到的地方,双击打开然后关闭,配置文件将会生成在程序所在位置的根目录下的XiaoFeimianConfig文件夹。例如:XiaoFeimian.exe程序放在D:\DaFeimian\Robot\dfm520\...下,第一次打开后,配置文件就会在D:\XiaoFeimianConfig\...下。**注意:**程序是多线程运行的,可能关闭之后会卡到线程,需要在任务管理器中查看是否仍在后台运行,然后关闭掉!
      6. 修改小肥免(XiaoFeimian)的配置文件config.json:
        • format_version: 版本号
        • key: 不用填
        • host: 地址,对应mirai-api-http-2.10.0的配置文件http里的那个host
        • port: 端口,对应mirai-api-http-2.10.0的配置文件http里的那个port
        • qq: 你的QQ号,对应mirai-api-http-2.10.0的配置文件http里的那个port
        • session: 不用填,对应mirai-api-http-2.10.0的配置文件singleMode设置为true
        • dfm:learning_list: 学习群聊的群号列表
        • dfm:reply_list: 回复群聊的群号列表
        • dfm:chance: 回复概率(0~1)
        • dfm:cos_match: 是否进行相似度计算以寻找答案(bool)
        • dfm:cos_match_value: 相似度计算达到多少就匹配答案(0~1)
        • dfm:reply_wait_base_time: 回复行为的基础等待时间
        • dfm:reply_wait_float_time: 回复行为的浮动时间(+-)
          你也可以在XiaoFeimian.exe程序里输入config help来查看这些信息。
      7. 修改完毕之后,保证Mirai正常运行以及登录QQ,然后打开XiaoFeimian.exe程序就可以辣!看到这个就表示连接成功~
        image

      效果图

      ee0287e9-6afd-4535-bd90-6394728ba93e-image.png

      1397905002 1 Reply Last reply Reply Quote 2
      • C
        CXbve5 last edited by

        好欸,沙发,亲亲!

        santsue 1 Reply Last reply Reply Quote 0
        • santsue
          santsue @CXbve5 last edited by

          @CXbve5 是可爱芥子!

          1 Reply Last reply Reply Quote 0
          • LeonCCCCC
            LeonCCCCC last edited by

            感谢大佬开发!
            之前一直在用ChatLearning,但是似乎随着语料库的增加会导致内存占用越来越大,2GB的云服务器根本顶不住,基本每天都要崩溃一次orz
            话说请问一下目前该项目是只支持在Windows上使用吗?能否在Linux系统上启动服务呢?

            santsue S 2 Replies Last reply Reply Quote 0
            • A
              a772813042 last edited by

              似乎配置文件不能正常保存,但修改后程序读取是可以的?

              santsue 1 Reply Last reply Reply Quote 0
              • santsue
                santsue @LeonCCCCC last edited by

                @LeonCCCCC 啊目前只能在win使用,因为我不会写linux的程序哈哈,我看任务管理器这个程序就占用不超过20M运存来着

                1 Reply Last reply Reply Quote 0
                • santsue
                  santsue @a772813042 last edited by

                  @a772813042 有可能配置文件被占用了,保存会被覆盖,等我后续更新一下配置文件热更功能叭

                  1 Reply Last reply Reply Quote 0
                  • S
                    smoadrareun @LeonCCCCC last edited by

                    @LeonCCCCC 直接下载源码也可以放在Linux上跑

                    1 Reply Last reply Reply Quote 0
                    • 这
                      这个小暗不太冷 last edited by

                      Welcome to use DaFeimian python exe -- XiaoFeimian Chat Learning
                      欢迎使用大肥免python程序——小肥免聊天学习
                      Tips: Idk if Chinese can run the display smoothly, so some content uses English prompts.
                      我不知道中文能不能顺利运行显示,所以一些内容使用的是英文提示,肥免懒得设置编码
                      Config file loading completed. Version is 1.0.3
                      Starting config file simple verification. Maybe have other error what can not test.
                      Starting Completed
                      Start connect http

                      key:
                      host: localhost
                      port: 23750
                      qq: 3567749021
                      session:

                      <Response [200]>
                      Http is connected.
                      Wait 10 seconds to start the command.
                      Loading command list.
                      XiaoFeimian Command:Robot has 1 messages not read.
                      9999 0
                      Not learning msg.
                      Robot has 1 messages not read.
                      Not learning msg.
                      Robot has 1 messages not read.
                      9999 0
                      Not learning msg.
                      Robot has 1 messages not read.
                      Not learning msg.
                      Robot has 1 messages not read.
                      Not learning msg.
                      Robot has 1 messages not read.
                      Not learning msg.
                      Robot has 1 messages not read.
                      9999 0
                      Not learning msg.
                      Robot has 1 messages not read.
                      9999 0
                      Not learning msg.
                      Robot has 1 messages not read.
                      9999 0
                      Not learning msg.
                      Robot has 1 messages not read.
                      Not learning msg.
                      Robot has 1 messages not read.
                      Not learning msg.
                      Robot has 1 messages not read.
                      Not learning msg.
                      Robot has 1 messages not read.
                      9999 0
                      Not learning msg.

                      您好 我似乎是成功运行了 但是我在.exe程序根目录下并没有生成config的配置文件 请问该如何解决呢?

                      santsue 1 Reply Last reply Reply Quote 0
                      • santsue
                        santsue @这个小暗不太冷 last edited by

                        @这个小暗不太冷 不是在程序的根目录下哦,是在程序所在的磁盘根目录下

                        1 Reply Last reply Reply Quote 0
                        • 1397905002
                          1397905002 @santsue last edited by

                          @santsue QQ图片20240425164425.png 不知为何连接失败了

                          1 Reply Last reply Reply Quote 0
                          • yzyzdkami
                            yzyzdkami last edited by

                            运行后没有生成对应的配置文件如何解决

                            1 Reply Last reply Reply Quote 0
                            • 1 / 1
                            • First post
                              Last post
                            Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact