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
030eb6b7
Commit
030eb6b7
authored
Oct 03, 2020
by
wdvxdr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature support [CQ:tts]
parent
6b706ca3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
coolq/cqcode.go
coolq/cqcode.go
+9
-0
docs/cqhttp.md
docs/cqhttp.md
+16
-0
No files found.
coolq/cqcode.go
View file @
030eb6b7
...
...
@@ -364,6 +364,15 @@ func (bot *CQBot) ToElement(t string, d map[string]string, group bool) (message.
return
nil
,
errors
.
New
(
"invalid gift id"
)
}
return
&
GiftElement
{
Target
:
t
,
GiftId
:
GiftId
[
id
]},
nil
case
"tts"
:
if
!
group
{
return
nil
,
errors
.
New
(
"private voice unsupported now"
)
}
data
,
err
:=
bot
.
Client
.
GetTts
(
d
[
"text"
])
if
err
!=
nil
{
return
nil
,
err
}
return
&
message
.
VoiceElement
{
Data
:
data
},
nil
case
"record"
:
if
!
group
{
return
nil
,
errors
.
New
(
"private voice unsupported now"
)
...
...
docs/cqhttp.md
View file @
030eb6b7
...
...
@@ -287,6 +287,22 @@ Type: `cardimage`
[CQ:cardimage,file=https://i.pixiv.cat/img-master/img/2020/03/25/00/00/08/80334602_p0_master1200.jpg]
```
### 文本转语音
> 注意:通过TX的TTS接口,采用的音源与登录账号的性别有关
Type:
`tts`
范围:
**发送(仅群聊)**
参数:
| 参数名 | 类型 | 说明 |
| ------ | ------ | ----------- |
| text | string | 内容 |
示例:
`[CQ:tts,text=这是一条测试消息]`
## API
### 设置群名
...
...
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