🐛 Fixed markdown entities parsing in reply message on '/start'

This commit is contained in:
Maxim Lebedev 2017-11-30 03:12:40 +05:00
parent 63e4e594ce
commit b396e46d26
No known key found for this signature in database
GPG Key ID: F8978F46FF0FFA4F
3 changed files with 6 additions and 3 deletions

View File

@ -81,7 +81,7 @@ reply_reset:
Or use /{{.CancelCommand}} for abort current operation.
reply_start:
other: |
Hello, I'm the @{{.Username}}!
Hello, I'm the [@{{.Username}}](tg://user?id={{.ID}})!
I can create your personal pack with stickers from others packs.
Without limits and installing. In any chat. For free.
success_add:

View File

@ -1,6 +1,6 @@
reply_start:
other: |
Hello, I'm the @{{.Username}}!
Hello, I'm the [@{{.Username}}](tg://user?id={{.ID}})!
I can create your personal pack with stickers from others packs.
Without limits and installing. In any chat. For free.
reply_add_sticker:

View File

@ -1,6 +1,8 @@
package main
import (
"strings"
log "github.com/kirillDanshin/dlog" // Insert logs only in debug builds
"github.com/toby3d/go-telegram" // My Telegram bindings
)
@ -13,7 +15,7 @@ func commandStart(msg *telegram.Message) {
if msg.HasArgument() {
log.Ln("Received a", msg.Command(), "command with", msg.CommandArgument(), "argument")
if msg.CommandArgument() == cmdAddSticker {
if strings.ToLower(msg.CommandArgument()) == strings.ToLower(cmdAddSticker) {
commandAdd(msg, false)
return
}
@ -25,6 +27,7 @@ func commandStart(msg *telegram.Message) {
reply := telegram.NewMessage(
msg.Chat.ID, T("reply_start", map[string]interface{}{
"Username": bot.Self.Username,
"ID": bot.Self.ID,
}),
)
reply.ParseMode = telegram.ModeMarkdown