MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接
    1. Home
    2. VIPWYH2004
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 3
    • Best 0
    • Controversial 0
    • Groups 0

    VIPWYH2004

    @VIPWYH2004

    0
    Reputation
    3
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    VIPWYH2004 Unfollow Follow

    Latest posts made by VIPWYH2004

    • 怎么在机器人发送消息之前,修改消息的内容

      我现在使用的是下面的方法(直接放在onEnable中)

      GlobalEventChannel.subscribeAlways<MessagePreSendEvent> {
                  for (msg in message.toMessageChain()) {
                      var resultType = false
                      val result = when (msg) {
                          is PlainText -> AipCensor.textCensor(client,msg)
                          is Image -> AipCensor.imageCensor(client,msg)
                          else -> JSONObject("null")
                      }
                      if (result.get("conclusion").equals("不合规")){
                          resultType = true
                          message = PlainText(ApiConfig.BlockMessage)
                      }
                      if (resultType) break
                  }
              }
      

      现在的情况是message = PlainText(ApiConfig.BlockMessage)这一条执行后机器人发送的消息还是原来的message的内容,但是控制台输出的内容是修改后的内容
      QQ截图20230322204932.png

      posted in 开发交流
      VIPWYH2004
      VIPWYH2004
    • RE: Mirai Content Censor 群内容审核插件

      能不能只审核机器人自己要发送的内容,如果违规,就阻止这次发送

      posted in 插件发布
      VIPWYH2004
      VIPWYH2004
    • RE: LuckPerms - Mirai - 高级权限服务插件

      怎么实现/perm add g111111111 group:test.testplugin的效果qwq

      posted in 插件发布
      VIPWYH2004
      VIPWYH2004