mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-08 04:55:55 +08:00
feature support [CQ:tts]
This commit is contained in:
parent
6b706ca3ff
commit
030eb6b7c4
@ -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 nil, errors.New("invalid gift id")
|
||||||
}
|
}
|
||||||
return &GiftElement{Target: t, GiftId: GiftId[id]}, nil
|
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":
|
case "record":
|
||||||
if !group {
|
if !group {
|
||||||
return nil, errors.New("private voice unsupported now")
|
return nil, errors.New("private voice unsupported now")
|
||||||
|
@ -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]
|
[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
|
## API
|
||||||
|
|
||||||
### 设置群名
|
### 设置群名
|
||||||
|
Loading…
x
Reference in New Issue
Block a user