Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit 1d13d88

Browse files
committed
更新: 语音消息示例;
1 parent 553a39f commit 1d13d88

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

examples/VoiceMessage.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,15 @@ int main()
2727
bot.On<GroupMessage>(
2828
[&](GroupMessage m)
2929
{
30-
MiraiVoice voice;
31-
voice.Id = "BDD8FD5EAF989C4F4B7DB4D853A9509E.amr";
32-
m.Reply(MessageChain().Voice(voice));
30+
try
31+
{
32+
MiraiVoice voice = bot.UploadGroupVoice("D:\\5.amr");
33+
m.Reply(MessageChain().Voice(voice));
34+
}
35+
catch (const std::exception& ex)
36+
{
37+
cout << ex.what() << endl;
38+
}
3339
});
3440

3541

0 commit comments

Comments
 (0)