mirai-cpp icon indicating copy to clipboard operation
mirai-cpp copied to clipboard

新增一系列无异常的 Try* 模式的接口

Open cyanray opened this issue 2 years ago • 0 comments

比如发送消息(SendMessage),有时候并不在意它能不能发送成功(或者发送失败的原因),现在可以这样写:

try
{
    SendMessage(xxxx, xxxxx);
}
catch(...){}

可以尝试增加类似下面的API,简化一下:

bool TrySendMessage(QQ_t friend, const MessageChain& messages) noexcept;

cyanray avatar Nov 15 '21 07:11 cyanray