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
b229b9e5
Commit
b229b9e5
authored
Aug 07, 2020
by
Mrs4s
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #37.
parent
6effdcc5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
4 deletions
+16
-4
coolq/api.go
coolq/api.go
+6
-0
coolq/cqcode.go
coolq/cqcode.go
+4
-3
go.mod
go.mod
+1
-1
go.sum
go.sum
+5
-0
No files found.
coolq/api.go
View file @
b229b9e5
...
...
@@ -121,6 +121,12 @@ func (bot *CQBot) CQSendGroupMessage(groupId int64, i interface{}) MSG {
return
Failed
(
100
)
}
elem
:=
bot
.
ConvertStringMessage
(
str
,
true
)
// fix at display
for
_
,
e
:=
range
elem
{
if
at
,
ok
:=
e
.
(
*
message
.
AtElement
);
ok
&&
at
.
Target
!=
0
{
at
.
Display
=
"@"
+
bot
.
Client
.
FindGroup
(
groupId
)
.
FindMember
(
at
.
Target
)
.
DisplayName
()
}
}
mid
:=
bot
.
SendGroupMessage
(
groupId
,
&
message
.
SendingMessage
{
Elements
:
elem
})
if
mid
==
-
1
{
return
Failed
(
100
)
...
...
coolq/cqcode.go
View file @
b229b9e5
...
...
@@ -192,12 +192,13 @@ func (bot *CQBot) ToElement(t string, d map[string]string, group bool) (message.
}
return
message
.
NewImage
(
b
),
nil
}
if
global
.
PathExists
(
path
.
Join
(
global
.
IMAGE_PATH
,
f
))
{
b
,
err
:=
ioutil
.
ReadFile
(
path
.
Join
(
global
.
IMAGE_PATH
,
f
))
rawPath
:=
path
.
Join
(
global
.
IMAGE_PATH
,
f
)
if
global
.
PathExists
(
rawPath
)
{
b
,
err
:=
ioutil
.
ReadFile
(
rawPath
)
if
err
!=
nil
{
return
nil
,
err
}
if
path
.
Ext
(
path
.
Join
(
global
.
IMAGE_PATH
,
f
)
)
!=
".image"
{
if
path
.
Ext
(
rawPath
)
!=
".image"
{
return
message
.
NewImage
(
b
),
nil
}
if
len
(
b
)
<
20
{
...
...
go.mod
View file @
b229b9e5
...
...
@@ -3,7 +3,7 @@ module github.com/Mrs4s/go-cqhttp
go 1.14
require (
github.com/Mrs4s/MiraiGo v0.0.0-2020080
4064012-e1e00ed0683b
github.com/Mrs4s/MiraiGo v0.0.0-2020080
6174029-46d4a5d8a13a
github.com/gin-gonic/gin v1.6.3
github.com/gorilla/websocket v1.4.2
github.com/guonaihong/gout v0.1.1
...
...
go.sum
View file @
b229b9e5
...
...
@@ -2,6 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Mrs4s/MiraiGo v0.0.0-20200804064012-e1e00ed0683b h1:HBZgam4cS+6/XFVXVcEv3YINozw2qUjnZIhj6EQXLbU=
github.com/Mrs4s/MiraiGo v0.0.0-20200804064012-e1e00ed0683b/go.mod h1:M9wh1hjd0rie3+wm27tjPZkYMbD+MBV76CGqp2G7WSU=
github.com/Mrs4s/MiraiGo v0.0.0-20200806174029-46d4a5d8a13a h1:euIKXyIIY7joi5SEsTnibffhc7SsUYyacJHGYJUbGWM=
github.com/Mrs4s/MiraiGo v0.0.0-20200806174029-46d4a5d8a13a/go.mod h1:0je03wji/tSw4bUH4QCF2Z4/EjyNWjSJTyy5tliX6EM=
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
...
...
@@ -36,6 +38,8 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1 h1:ZFgWrT+bLgsYPirOnRfKLYJLvssAegOj/hgyMFdJZe0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
...
...
@@ -146,6 +150,7 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
...
...
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