mirror of
https://github.com/HugeFrog24/go-telegram-bot.git
synced 2026-03-02 08:24:34 +00:00
md formatting doesnt work yet
This commit is contained in:
9
bot.go
9
bot.go
@@ -203,13 +203,10 @@ func initTelegramBot(token string, handleUpdate func(ctx context.Context, tgBot
|
|||||||
return bot.New(token, opts...)
|
return bot.New(token, opts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// sendResponse sends a message to the specified chat.
|
|
||||||
// Returns an error if sending the message fails.
|
|
||||||
func (b *Bot) sendResponse(ctx context.Context, chatID int64, text string, businessConnectionID string) error {
|
func (b *Bot) sendResponse(ctx context.Context, chatID int64, text string, businessConnectionID string) error {
|
||||||
params := &bot.SendMessageParams{
|
params := &bot.SendMessageParams{
|
||||||
ChatID: chatID,
|
ChatID: chatID,
|
||||||
Text: text,
|
Text: text,
|
||||||
ParseMode: models.ParseModeMarkdown,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if businessConnectionID != "" {
|
if businessConnectionID != "" {
|
||||||
@@ -236,9 +233,9 @@ func (b *Bot) sendStats(ctx context.Context, chatID int64, userID int64, usernam
|
|||||||
|
|
||||||
// Do NOT manually escape hyphens here
|
// Do NOT manually escape hyphens here
|
||||||
statsMessage := fmt.Sprintf(
|
statsMessage := fmt.Sprintf(
|
||||||
"📊 *Bot Statistics:*\n\n"+
|
"📊 Bot Statistics:\n\n"+
|
||||||
"\\- Total Users: %d\n"+
|
"- Total Users: %d\n"+
|
||||||
"\\- Total Messages: %d",
|
"- Total Messages: %d",
|
||||||
totalUsers,
|
totalUsers,
|
||||||
totalMessages,
|
totalMessages,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user