mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 03:23:49 +08:00
commit
30ff055126
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@ -17,6 +17,8 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set RELEASE_VERSION env
|
||||||
|
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF:10}
|
||||||
- uses: wangyoucao577/go-release-action@master
|
- uses: wangyoucao577/go-release-action@master
|
||||||
env:
|
env:
|
||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
@ -24,4 +26,5 @@ jobs:
|
|||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
goos: ${{ matrix.goos }}
|
goos: ${{ matrix.goos }}
|
||||||
goarch: ${{ matrix.goarch }}
|
goarch: ${{ matrix.goarch }}
|
||||||
ldflags: "-w -s"
|
ldflags: -w -s -X "github.com/Mrs4s/go-cqhttp/coolq.version=${{ env.RELEASE_VERSION }}"
|
||||||
|
|
16
coolq/api.go
16
coolq/api.go
@ -1,20 +1,23 @@
|
|||||||
package coolq
|
package coolq
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Mrs4s/MiraiGo/binary"
|
|
||||||
"github.com/Mrs4s/MiraiGo/client"
|
|
||||||
"github.com/Mrs4s/MiraiGo/message"
|
|
||||||
"github.com/Mrs4s/go-cqhttp/global"
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
"github.com/tidwall/gjson"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/Mrs4s/MiraiGo/binary"
|
||||||
|
"github.com/Mrs4s/MiraiGo/client"
|
||||||
|
"github.com/Mrs4s/MiraiGo/message"
|
||||||
|
"github.com/Mrs4s/go-cqhttp/global"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
"github.com/tidwall/gjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var version = "unknown"
|
||||||
|
|
||||||
// https://cqhttp.cc/docs/4.15/#/API?id=get_login_info-%E8%8E%B7%E5%8F%96%E7%99%BB%E5%BD%95%E5%8F%B7%E4%BF%A1%E6%81%AF
|
// https://cqhttp.cc/docs/4.15/#/API?id=get_login_info-%E8%8E%B7%E5%8F%96%E7%99%BB%E5%BD%95%E5%8F%B7%E4%BF%A1%E6%81%AF
|
||||||
func (bot *CQBot) CQGetLoginInfo() MSG {
|
func (bot *CQBot) CQGetLoginInfo() MSG {
|
||||||
return OK(MSG{"user_id": bot.Client.Uin, "nickname": bot.Client.Nickname})
|
return OK(MSG{"user_id": bot.Client.Uin, "nickname": bot.Client.Nickname})
|
||||||
@ -578,6 +581,7 @@ func (bot *CQBot) CQGetVersionInfo() MSG {
|
|||||||
"plugin_build_configuration": "release",
|
"plugin_build_configuration": "release",
|
||||||
"runtime_version": runtime.Version(),
|
"runtime_version": runtime.Version(),
|
||||||
"runtime_os": runtime.GOOS,
|
"runtime_os": runtime.GOOS,
|
||||||
|
"version": version,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user