MiraiForum

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

    Drift Bottle 漂流瓶插件

    插件发布
    40
    135
    24644
    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.
    • Samarium150
      Samarium150 童心未泯 last edited by Samarium150

      mirai-console-drift-bottle

      地址:GitHub

      简单的漂流瓶插件,基本照抄了Dice!项目的漂流瓶功能

      可以在私聊或者群聊中丢出包含任意消息的漂流瓶, 其他人通过捡起漂流瓶即可看到相应的消息

      也可以通过跳海来查看海里有多少物品

      具体使用文档放在了 wiki 页面 和 二楼

      GitHub top language
      GitHub
      GitHub all releases
      visitors

      下图是功能演示
      example.png

      1 Reply Last reply Reply Quote 3
      • Samarium150
        Samarium150 童心未泯 last edited by Samarium150

        使用说明

        本楼的内容可能更新不及时,以 wiki 页面为准

        前置条件

        • Java 11 及以上
        • mirai-console
          本插件最新版目前只在 2.9.2 做了测试(只在最新版测试的屑)
        • 启动器
          应该没人想手动启动mirai-console, 如果想, 请看 这里
          启动器推荐官方的 MCL,使用方法参见官方 用户手册
        • chat-command
          允许在聊天环境执行命令, 下载release中的jar文件并放入plugins文件夹中

        加载

        直接将Release中的mirai-console-drift-bottle.*.mirai.jar放到plugins中, 重新启动控制台即可
        如果MCL文件夹里没有plugins这个文件夹, 就先启动一次

        权限分配

        • io.github.samarium150.mirai.plugin.mirai-console-drift-bottle:command.pickup 捡起漂流瓶
        • io.github.samarium150.mirai.plugin.mirai-console-drift-bottle:command.jump-into 查看有多少物体在海中
        • io.github.samarium150.mirai.plugin.mirai-console-drift-bottle:command.throw-away 丢出漂流瓶
        • io.github.samarium150.mirai.plugin.mirai-console-drift-bottle:command.sea 漂流瓶操作复合指令
        • io.github.samarium150.mirai.plugin.mirai-console-drift-bottle:command.comment 评论漂流瓶

        在console使用/perm permit * io.github.samarium150.mirai.plugin.mirai-console-drift-bottle:*来赋予所有联系对象使用本插件所有命令的权限

        配置

        console版本在2.9.0-RC以上时,
        配置文件位于config/io.github.samarium150.mirai.plugin.mirai-console-drift-bottle目录下
        否则在config/Drift Bottle目录下

        配置文件可以在console运行时修改,但依旧需要重启console才能生效

        以下是完成的配置文件的参考:

        General.yml

        # 捡起命令不减少漂流瓶总数
        incrementalBottle: true
        # 捡起命令不减少尸体总数
        incrementalBody: false
        # 是否启用内容审核
        enableContentCensor: false
        # 是否缓存漂流瓶图片到本地
        cacheImage: true
        # 漂流瓶功能连续使用间隔 (单位: 秒)
        perUse: 10
        # 随机延迟回复的时间区间 (单位: 毫秒)
        randomDelayInterval: 
          first: 1000
          second: 1500
        # 使用转发消息展示漂流瓶
        displayInForward: false
        

        内容审核开启后需要填写ContentCensor.yml中的内容,否则不会生效

        Command.yml

        # jump-into命令的别名
        jumpInto: 
          - 跳海
          - 跳进海里
        # pickup命令的别名
        pickup: 
          - 捡漂流瓶
        # throw-away命令的别名
        throwAway: 
          - 丢漂流瓶
        # comment命令的别名
        comment: 
          - 评论
        # sea-operation命令的别名
        seaOperation: 
          - 海
          - s
        

        Reply.yml

        # 海里没有物品时的回复
        noItem: '海里暂时没有物品哦~'
        # 捡起漂流瓶的回复
        pickupBottle: "你在海边捡到了一个来自【%source】的漂流瓶,打开瓶子,里面有一张纸条,写着:\n"
        # 捡起尸体的回复
        pickupBody: "海面飘来了【%who】的浮尸……\n他于【%time】"
        # 在私聊中跳海的修饰语
        inPrivate: "悄悄潜入深海……\n愿深蓝之意志保佑他的灵魂。"
        # 在群聊中跳海的修饰语
        inGroup: 在【%group】处的海边沉入深海……
        # 丢漂流瓶的回复
        throwAway: '你将一个写着【%content】的纸条塞入瓶中扔进大海,希望有人捞到吧~'
        # 跳进大海的回复
        jumpInto: "你缓缓走入大海,感受着海浪轻柔地拍打着你的小腿,膝盖……\n波浪卷着你的腰腹,你感觉有些把握不住平衡了……\n……\n你沉入海中,【%num】个物体与你一同沉浮。\n不知何处涌来一股暗流,你失去了意识。"
        # 等待漂流瓶内容的回复
        waitForNextMessage: '请把想说的话写在纸条上发送出来吧~'
        # 等待漂流瓶内容超时的回复
        timeout: 是不是没有还没有想到要写什么呢?那待会再找我也行哦
        # 漂流瓶内容不合规的回复
        invalid: '不要往瓶子里塞奇怪的东西哦~'
        # 漂流瓶使用速度过快的回复
        inCooldown: 好快啊,能不能慢一点
        # 漂流瓶消息类型被禁用的回复
        bannedMessageType: '不要往瓶子里塞这种类型的消息哦~'
        

        其中%source等为特殊标识,会在回复时被替换为实际的内容

        ContentCensor.yml

        API_KEY: ''
        SECRET_KEY: ''
        

        在General.yml中启用内容审核才需要填写,可以在百度内容审核平台 快速入门 这里找到申请步骤。

        审核策略请在 策略管理 页面自行调整

        v1.2.0只实现了文本和图片的审核

        Advanced

        # At显示为纯文本
        disableDirectAt: false
        # 漂流瓶消息类型控制
        # 可在此配置以下类型:
        # Image: 图片, LightApp: 小程序, Audio: 语音, FlashImage: 闪照
        # MarketFace: 商城表情, Dice: 骰子, ForwardMessage: 合并转发消息
        # FileMessage: 文件消息 (貌似漂流瓶无法存放文件,但还是先放着)
        saveMessageTypes: 
          Image: true
          LightApp: true
          Audio: true
          FlashImage: true
          MarketFace: true
          Dice: true
          ForwardMessage: true
          FileMessage: true
        

        使用

        • (/)throw-away [messages]
          丢出漂流瓶的命令,只能在聊天环境使用(私聊群聊均可),默认别名为丢漂流瓶,参数为留言的内容。内容包含空格时,空格会被删除。内容为空时会把下一条消息作为漂流瓶留言。
        • (/)pickup [index]
          捡起漂流瓶的命令,只能在聊天环境使用(私聊群聊均可),默认别名为捡漂流瓶,可选参数为漂流瓶的序号。可以看到别人在漂流瓶中的留言。
        • (/)jump-into
          查看大海中物品数量的命令,可以在聊天环境(私聊群聊均可)和控制台使用,默认别名为跳进海里和跳海。聊天环境下使用者会成为大海的一部分(笑)
        • (/)comment <comment> [index]
          评论漂流瓶的命令,只能在聊天环境使用(私聊群聊均可),默认别名为评论,参数为评论内容,且仅限纯文本,可选参数为漂流瓶的序号。
        • (/)sea
          漂流瓶操作复合命令,默认别名为海
          • query [index]
            获取漂流瓶信息的命令,别名为get,控制台使用时index为必填参数
          • rm [index]
            删除漂流瓶的命令,别名为del,控制台使用时index为必填参数
        1 Reply Last reply Reply Quote 0
        • tsudzuki
          tsudzuki 摸鱼 last edited by

          取。

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

            在"net.mamoe:mirai-console" v2.9.0-M1上无法正常使用

            • 已经给予权限
            > /permission pp *                                                                                                                                      
            com.github.samarium150.mirai-console-drift-bottle:* 
            
            • 在群里无法正常调用,但是在控制台可以正常使用
            2021-12-10 17:54:10 V/Bot.1026152696: [[NSFW]st-time(655957813)] Пулемет Р-46 (2909954314) -> 丢漂流瓶 测试
            > jump-into                                                                                                                                             
            你缓缓走入大海,感受着海浪轻柔地拍打着你的小腿,膝盖……                                                                                                  
            波浪卷着你的腰腹,你感觉有些把握不住平衡了……                                                                                                            
            ……                                                                                                                                                      
            你沉入海中,【0】个物体与你一同沉浮。                                                                                                                   
            不知何处涌来一股暗流,你失去了意识。
            
            Samarium150 1 Reply Last reply Reply Quote 0
            • Samarium150
              Samarium150 童心未泯 @VantHoff last edited by Samarium150

              @vanthoff 收到,我复现一下
              复现失败,试试直接使用/throw-away命令吧

              VantHoff 1 Reply Last reply Reply Quote 0
              • smmcat
                smmcat last edited by

                插件太棒了,感谢作者; 建议增加敏感词筛选机制,在存入数据前与 [自定义违禁词库] 中进行判断。避免有人用来发布广告或者色情内容导致姬器人被封

                Samarium150 2 Replies Last reply Reply Quote 0
                • Samarium150
                  Samarium150 童心未泯 @smmcat last edited by

                  @smmcat 行,我加到to-do里(有时间会写的)

                  1 Reply Last reply Reply Quote 1
                  • smmcat
                    smmcat last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • VantHoff
                      VantHoff @Samarium150 last edited by VantHoff

                      @samarium150

                      > 丢漂流瓶 测试
                      2021-12-10 18:43:40 W/console: 参数不匹配, 你是否想执行: 
                      (/)throw-away <messages>    (需要由 CommandSenderOnMessage 执行)
                      > throw-away 测试
                      2021-12-10 18:44:01 W/console: 参数不匹配, 你是否想执行: 
                      (/)throw-away <messages>    (需要由 CommandSenderOnMessage 执行)
                      > /throw-away 测试
                      2021-12-10 18:44:12 W/console: 参数不匹配, 你是否想执行: 
                      (/)throw-away <messages>    (需要由 CommandSenderOnMessage 执行)
                      2021-12-10 18:44:44 V/Bot.1026152696: [[NSFW]st-time(655957813)] Пулемет РП-46 (2909954314) -> /throw-away 测试
                      2021-12-10 18:45:18 V/Bot.1026152696: [[NSFW]st-time(655957813)] Пулемет РП-46 (2909954314) -> /throw-away 测试
                      2021-12-10 18:45:27 V/Bot.1026152696: Пулемет РП-46 (2909954314) -> 跳海
                      

                      同样不行(

                      Samarium150 1 Reply Last reply Reply Quote 0
                      • Samarium150
                        Samarium150 童心未泯 @VantHoff last edited by

                        @vanthoff chat-command装了吗,控制台确实不能用/throw-away

                        VantHoff 1 Reply Last reply Reply Quote 0
                        • VantHoff
                          VantHoff @Samarium150 last edited by VantHoff

                          @samarium150
                          麻了,我的问题,我以为我装了(
                          安装完chat-command后可以正常使用。

                          Samarium150 1 Reply Last reply Reply Quote 0
                          • Samarium150
                            Samarium150 童心未泯 @VantHoff last edited by

                            @vanthoff 解决了就好

                            1 Reply Last reply Reply Quote 0
                            • 白
                              白嫖怪林先生 last edited by

                              啧啧,挺有趣的,不过,跳海后不能复活了吗?

                              Samarium150 1 Reply Last reply Reply Quote 0
                              • 白
                                白嫖怪林先生 last edited by

                                有删除已扔漂流瓶的功能吗?

                                Samarium150 1 Reply Last reply Reply Quote 0
                                • Samarium150
                                  Samarium150 童心未泯 @白嫖怪林先生 last edited by

                                  @白嫖怪林先生 跳海的目的也就是查看海里面的物品数量而已,你想跳几次都可以

                                  1 Reply Last reply Reply Quote 0
                                  • Samarium150
                                    Samarium150 童心未泯 @白嫖怪林先生 last edited by

                                    @白嫖怪林先生 没有直接删除特定漂流瓶的功能,但你可以在控制台关闭的情况下修改data/Drift Bottle/Sea.yml来达到这个目的。一般情况下设置incremental为false,则捡到的漂流瓶会从海里删除

                                    1 Reply Last reply Reply Quote 0
                                    • ryoii
                                      ryoii 梦中的鸡翅 last edited by

                                      有意思

                                      1 Reply Last reply Reply Quote 0
                                      • F
                                        FakerCsr last edited by

                                        您好,下载了相应的插件了,可惜还是用不了漂流瓶功能,这是什么原因呢

                                        1

                                        2

                                        3

                                        Samarium150 1 Reply Last reply Reply Quote 0
                                        • L
                                          lord last edited by

                                          32a4bb7a-ecb7-45e5-bbca-985012f57ef7-image.png
                                          用不了报错了

                                          Samarium150 1 Reply Last reply Reply Quote 0
                                          • Samarium150
                                            Samarium150 童心未泯 @FakerCsr last edited by

                                            @fakercsr 权限分配了吗

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