Method
sendOrEdit
(msg: Api.Message, text: string, parseMode: "html" | "markdown" = "html")
Source from the content-addressed store, hash-verified
| 131 | |
| 132 | class MessageSender { |
| 133 | static async sendOrEdit(msg: Api.Message, text: string, parseMode: "html" | "markdown" = "html"): Promise<Api.Message | undefined> { |
| 134 | try { |
| 135 | return await msg.edit({ text, parseMode, linkPreview: false } as any); |
| 136 | } catch { |
| 137 | return await msg.reply({ message: text, parseMode, linkPreview: false } as any); |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | static async sendNew( |
| 142 | msg: Api.Message, |
Tested by
no test coverage detected