return append([]fakeBotCall(nil), f.calls...)
}
-// Sent returns the texts of the sendMessage calls that succeeded.
+// Sent returns the texts of the sendMessage calls and the Markdown of the
+// sendRichMessage calls that succeeded, in order.
func (f *fakeBot) Sent() []string {
var texts []string
for _, call := range f.Calls() {
- if call.method == "sendMessage" && call.ok {
+ switch {
+ case !call.ok:
+ case call.method == "sendMessage":
texts = append(texts, call.params["text"].(string))
+ case call.method == "sendRichMessage":
+ texts = append(texts, call.params["rich_message"].(map[string]any)["markdown"].(string))
}
}