MiraiForum

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

    Unsolved 如何以控制台身份执行命令并获取返回

    开发交流
    2
    2
    111
    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.
    • Z
      zhou2008 摸鱼 last edited by

      在mirai-console插件开发中
      如何以控制台身份执行命令并获取返回?
      CommandExecuteResult这个又该如何使用呢
      以及插件怎么获取控制台的日志?

      1 Reply Last reply Reply Quote 0
      • Samarium150
        Samarium150 ⭐2021⭐ last edited by

        when (val result = CommandManager.executeCommand(ConsoleCommandSender, YourCommand)) {
            is PermissionDenied -> {}
            // 此处省略
        }
        

        我只知道有这个,但没实际用过

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