update: msg

This commit is contained in:
ctwj
2025-09-22 23:55:27 +08:00
parent 3aa2963211
commit 6b92061d09

View File

@@ -19,6 +19,8 @@ import (
"github.com/robfig/cron/v3"
)
// https://core.telegram.org/bots/api
type TelegramBotService interface {
Start() error
Stop() error
@@ -1126,33 +1128,22 @@ func (s *TelegramBotServiceImpl) SendMessageWithFormat(chatID int64, text string
}
}
msg1 := tgbotapi.NewMessage(chatID, "*bold text*\n"+
"_italic \n"+
"__underline__\n"+
"~strikethrough~\n"+
"||spoiler||\n"+
"*bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold*\n"+
"[inline URL](http://www.example.com/)\n"+
"[inline mention of a user](tg://user?id=123456789)\n"+
"![👍](tg://emoji?id=5368324170671202286)\n"+
"`inline fixed-width code`\n"+
"```\n"+
"pre-formatted fixed-width code block\n"+
"```\n"+
"```python\n"+
"pre-formatted fixed-width code block written in the Python programming language\n"+
"```\n"+
">Block quotation started\n"+
">Block quotation continued\n"+
">Block quotation continued\n"+
">Block quotation continued\n"+
">The last line of the block quotation\n"+
"**>The expandable block quotation started right after the previous block quotation\n"+
">It is separated from the previous block quotation by an empty bold entity\n"+
">Expandable block quotation continued\n"+
">Hidden by default part of the expandable block quotation started\n"+
">Expandable block quotation continued\n"+
">The last line of the expandable block quotation with the expandability mark||")
msg1 := tgbotapi.NewMessage(chatID,
"<b>bold</b>, <strong>bold</strong>"+
"<i>italic</i>, <em>italic</em>"+
"<u>underline</u>, <ins>underline</ins>"+
"<s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>"+
"<span class=\"tg-spoiler\">spoiler</span>, <tg-spoiler>spoiler</tg-spoiler>"+
"<b>bold <i>italic bold <s>italic bold strikethrough <span class=\"tg-spoiler\">italic bold strikethrough spoiler</span></s> <u>underline italic bold</u></i> bold</b>"+
"<a href=\"http://www.example.com/\">inline URL</a>"+
"<a href=\"tg://user?id=123456789\">inline mention of a user</a>"+
"<tg-emoji emoji-id=\"5368324170671202286\">👍</tg-emoji>"+
"<code>inline fixed-width code</code>"+
"<pre>pre-formatted fixed-width code block</pre>"+
"<pre><code class=\"language-python\">pre-formatted fixed-width code block written in the Python programming language</code></pre>"+
"<blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>"+
"<blockquote expandable>Expandable block quotation started\nExpandable block quotation continued\nExpandable block quotation continued\nHidden by default part of the block quotation started\nExpandable block quotation continued\nThe last line of the block quotation</blockquote>")
msg1.ParseMode = "HTML"
s.bot.Send(msg1)
_, err := s.bot.Send(msg)