-// Calls returns the calls so far.
-func (f *TelegramFake) Calls() []TelegramFakeCall {
- f.mutex.Lock()
- defer f.mutex.Unlock()
-
- return append([]TelegramFakeCall(nil), f.calls...)
-}
-
-// Sent returns the texts of the sendMessage calls and the Markdown of the
-// sendRichMessage calls that succeeded, in order.
-func (f *TelegramFake) Sent() []string {
- var texts []string
-
- for _, call := range f.Calls() {
- 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))
- }
- }