Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
go-cqhttp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
go-cqhttp
Commits
30ff0551
Commit
30ff0551
authored
Aug 21, 2020
by
Mrs4s
Committed by
GitHub
Aug 21, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #148 from xuthus5/master
add:go-cqhttp_version
parents
f8d74a6a
5ec4e333
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
.github/workflows/release.yml
.github/workflows/release.yml
+4
-1
coolq/api.go
coolq/api.go
+10
-6
No files found.
.github/workflows/release.yml
View file @
30ff0551
...
...
@@ -17,6 +17,8 @@ jobs:
steps
:
-
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
env
:
CGO_ENABLED
:
0
...
...
@@ -24,4 +26,5 @@ jobs:
github_token
:
${{ secrets.GITHUB_TOKEN }}
goos
:
${{ matrix.goos }}
goarch
:
${{ matrix.goarch }}
ldflags
:
"
-w
-s"
ldflags
:
-w -s -X "github.com/Mrs4s/go-cqhttp/coolq.version=${{ env.RELEASE_VERSION }}"
\ No newline at end of file
coolq/api.go
View file @
30ff0551
package
coolq
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"
"os"
"path"
"runtime"
"strconv"
"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
func
(
bot
*
CQBot
)
CQGetLoginInfo
()
MSG
{
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"
,
"runtime_version"
:
runtime
.
Version
(),
"runtime_os"
:
runtime
.
GOOS
,
"version"
:
version
,
})
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment