Microsoft bot 框架模拟器正在自行放置行号

Microsoft bot framework emulator is putting line numbers by itself

我正在模拟器上 return 发送消息并将这些消息与行号一起放入,但显然 bot 模拟器有其特定的记录编号方式,我该如何停止?例如这段代码是 returning 1.Test 2.Test 3.Test 而它应该 return 1.Test 3.Test 5.Test

 public async Task<Message> Post([FromBody]Message message)
    {
        if (message.Type == "Message")
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("1. Test ");
            str.AppendLine("3. Test ");
            str.AppendLine("5. Test ");
            return message.CreateReplyMessage(str.ToString());
        }
        else
        {
            return HandleSystemMessage(message);
        }
    }

不,机器人模拟器不是枚举你的消息的 records.The 文本 属性 是用 Markdown 表达的(参见 documentation)因此我猜模拟器正在解析你的 1 . 作为有序列表。

您可以尝试删除点 (".") 或使用反斜杠 ("\") 转义字符。您可以阅读有关如何转义字符 here.

的更多信息