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
739d486b
Commit
739d486b
authored
Aug 20, 2020
by
xuthus5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:go-cqhttp_version
parent
322b70c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
140 additions
and
6 deletions
+140
-6
build.sh
build.sh
+130
-0
coolq/api.go
coolq/api.go
+10
-6
No files found.
build.sh
0 → 100644
View file @
739d486b
#!/usr/bin/env bash
#
# automatically generated in linux environment
#
# automatically generate version information:
# go build -ldflags "-X path.varname=varvalue" -o filename .
#
# shell use e.g:
# ./build.sh v1.0.0
# /get_version_info => version:v1.0.0
#
# all comb to compile
# $GOOS $GOARCH
# android arm
# darwin 386
# darwin amd64
# darwin arm
# darwin arm64
# dragonfly amd64
# freebsd 386
# freebsd amd64
# freebsd arm
# linux 386
# linux amd64
# linux arm
# linux arm64
# linux ppc64
# linux ppc64le
# linux mips
# linux mipsle
# linux mips64
# linux mips64le
# netbsd 386
# netbsd amd64
# netbsd arm
# openbsd 386
# openbsd amd64
# openbsd arm
# plan9 386
# plan9 amd64
# solaris amd64
# windows 386
# windows amd64
function
build_linux32
()
{
export
GOOS
=
linux
export
GOARCH
=
386
filename
=
go-cqhttp-
"
$1
"
-linux-386
go build
-ldflags
"-X github.com/Mrs4s/go-cqhttp/coolq.version=
$1
"
-o
"
$filename
"
.
tar
zcvf
"
$filename
"
.tar.gz
"
$filename
"
--remove-files
md5sum
"
$filename
"
.tar.gz
>
"
$filename
"
.tar.gz.md5
mv
"
$filename
"
.tar.gz ./dist
mv
"
$filename
"
.tar.gz.md5 ./dist
}
function
build_linux64
()
{
export
GOOS
=
linux
export
GOARCH
=
amd64
filename
=
go-cqhttp-
"
$1
"
-linux-amd64
go build
-ldflags
"-X github.com/Mrs4s/go-cqhttp/coolq.version=
$1
"
-o
"
$filename
"
.
tar
zcvf
"
$filename
"
.tar.gz
"
$filename
"
--remove-files
md5sum
"
$filename
"
.tar.gz
>
"
$filename
"
.tar.gz.md5
mv
"
$filename
"
.tar.gz ./dist
mv
"
$filename
"
.tar.gz.md5 ./dist
}
function
build_win32
()
{
export
GOOS
=
windows
export
GOARCH
=
386
filename
=
go-cqhttp-
"
$1
"
-windows-386
go build
-ldflags
"-X github.com/Mrs4s/go-cqhttp/coolq.version=
$1
"
-o
"
$filename
"
.
tar
zcvf
"
$filename
"
.tar.gz
"
$filename
"
--remove-files
md5sum
"
$filename
"
.tar.gz
>
"
$filename
"
.tar.gz.md5
mv
"
$filename
"
.tar.gz ./dist
mv
"
$filename
"
.tar.gz.md5 ./dist
}
function
build_win64
()
{
export
GOOS
=
windows
export
GOARCH
=
amd64
filename
=
go-cqhttp-
"
$1
"
-windows-amd64
go build
-ldflags
"-X github.com/Mrs4s/go-cqhttp/coolq.version=
$1
"
-o
"
$filename
"
.
tar
zcvf
"
$filename
"
.tar.gz
"
$filename
"
md5sum
"
$filename
"
.tar.gz
>
"
$filename
"
.tar.gz.md5
mv
"
$filename
"
.tar.gz ./dist
mv
"
$filename
"
.tar.gz.md5 ./dist
}
function
build_darwin32
()
{
export
GOOS
=
darwin
export
GOARCH
=
386
filename
=
go-cqhttp-
"
$1
"
-darwin-386
go build
-ldflags
"-X github.com/Mrs4s/go-cqhttp/coolq.version=
$1
"
-o
go-cqhttp-
"
$1
"
-darwin-386
.
tar
zcvf
"
$filename
"
.tar.gz
"
$filename
"
--remove-files
md5sum
"
$filename
"
.tar.gz
>
"
$filename
"
.tar.gz.md5
mv
"
$filename
"
.tar.gz ./dist
mv
"
$filename
"
.tar.gz.md5 ./dist
}
function
build_darwin64
()
{
export
GOOS
=
darwin
export
GOARCH
=
amd64
filename
=
go-cqhttp-
"
$1
"
-darwin-amd64
go build
-ldflags
"-X github.com/Mrs4s/go-cqhttp/coolq.version=
$1
"
-o
go-cqhttp-
"
$1
"
-darwin-amd64
.
tar
zcvf
"
$filename
"
.tar.gz
"
$filename
"
--remove-files
md5sum
"
$filename
"
.tar.gz
>
"
$filename
"
.tar.gz.md5
mv
"
$filename
"
.tar.gz ./dist
mv
"
$filename
"
.tar.gz.md5 ./dist
}
function
main
()
{
if
[
!
-d
'dist'
]
;
then
mkdir
dist
fi
#build_linux32 $1
build_linux64
$1
#build_win32 $1
#build_win64 $1
#build_darwin32 $1
#build_darwin64 $1
}
if
[
-n
"
$1
"
]
;
then
main
$1
else
echo
"No version info input...exit!"
fi
\ No newline at end of file
coolq/api.go
View file @
739d486b
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