Skip to content

Commit

Permalink
Added bot button to open source code
Browse files Browse the repository at this point in the history
  • Loading branch information
st-matskevich committed Sep 24, 2023
1 parent 424413c commit 5ff1be5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
func main() {
log.Println("Starting API service")

sourceCodeURL := "https://github.com/st-matskevich/tg-mini-app-template/"
webAppURL := os.Getenv("TELEGRAM_WEB_APP_URL")
botToken := os.Getenv("TELEGRAM_BOT_TOKEN")
botClient, err := gotgbot.NewBot(botToken, nil)
Expand Down Expand Up @@ -39,11 +40,13 @@ func main() {
return
}

message := "Welcome to the Telegram Mini App Template Bot\nTap the button below to open mini app"
message := "Welcome to the Telegram Mini App Template Bot\nTap the button below to open mini app or bot source code"
opts := &gotgbot.SendMessageOpts{
ReplyMarkup: gotgbot.InlineKeyboardMarkup{
InlineKeyboard: [][]gotgbot.InlineKeyboardButton{{
{Text: "Open mini app", WebApp: &gotgbot.WebAppInfo{Url: webAppURL}},
}, {
{Text: "Open source code", Url: sourceCodeURL},
}},
},
}
Expand Down

0 comments on commit 5ff1be5

Please sign in to comment.