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
6581394a
Commit
6581394a
authored
Sep 28, 2020
by
wdvxdr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix [CQ:record] & docs set_group_portrait
parent
2e59cb8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
docs/cqhttp.md
docs/cqhttp.md
+22
-0
global/fs.go
global/fs.go
+3
-2
No files found.
docs/cqhttp.md
View file @
6581394a
...
...
@@ -268,6 +268,28 @@ Type: `cardimage`
| group_id | int64 | 群号 |
| group_name | string | 新名 |
### 设置群头像
终结点:
`/set_group_portrait`
**参数**
| 字段 | 类型 | 说明 |
| -------- | ------ | ---- |
| group_id | int64 | 群号 |
| file | string | 图片文件名 |
| cache | int | 表示是否使用已缓存的文件 |
[1]
`file`
参数支持以下几种格式:
-
绝对路径,例如
`file:///C:\\Users\Richard\Pictures\1.png`
,格式使用
[
`file` URI
](
https://tools.ietf.org/html/rfc8089
)
-
网络 URL,例如
`http://i1.piimg.com/567571/fdd6e7b6d93f1ef0.jpg`
-
Base64 编码,例如
`base64://iVBORw0KGgoAAAANSUhEUgAAABQAAAAVCAIAAADJt1n/AAAAKElEQVQ4EWPk5+RmIBcwkasRpG9UM4mhNxpgowFGMARGEwnBIEJVAAAdBgBNAZf+QAAAAABJRU5ErkJggg==`
[2]
`cache`
参数: 通过网络 URL 发送时有效,
`1`
表示使用缓存,
`0`
关闭关闭缓存,默认 为
`1`
[3] 目前这个API在登录一段时间后因cookie失效而失效,请考虑后使用
### 获取图片信息
终结点:
`/get_image`
...
...
global/fs.go
View file @
6581394a
...
...
@@ -53,7 +53,7 @@ func IsAMRorSILK(b []byte) bool {
}
func
FindFile
(
f
,
cache
,
PATH
string
)
(
data
[]
byte
,
err
error
)
{
data
,
err
=
nil
,
errors
.
New
(
"
can't find the file: "
+
f
)
data
,
err
=
nil
,
errors
.
New
(
"
syntax error"
)
if
strings
.
HasPrefix
(
f
,
"http"
)
||
strings
.
HasPrefix
(
f
,
"https"
)
{
if
cache
==
""
{
cache
=
"1"
...
...
@@ -74,7 +74,8 @@ func FindFile(f, cache, PATH string) (data []byte, err error) {
return
nil
,
err
}
}
else
if
strings
.
HasPrefix
(
f
,
"file"
)
{
fu
,
err
:=
url
.
Parse
(
f
)
var
fu
*
url
.
URL
fu
,
err
=
url
.
Parse
(
f
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
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