From 7a9a8be3979549e48b1d07de4b1497d56b9ebf66 Mon Sep 17 00:00:00 2001 From: surdeus Date: Tue, 23 Jul 2024 23:43:26 +0500 Subject: [PATCH] fix: fixed Url to URL to fit the standartization. --- button.go | 10 +++++----- cmd/test/start.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/button.go b/button.go index 7c5b0ba..2b655cc 100644 --- a/button.go +++ b/button.go @@ -11,7 +11,7 @@ import ( type Button struct { Text string Data string - Url string + URL string SendLocation bool Action Action // Used to skip buttons in generating by functions. @@ -55,8 +55,8 @@ func (btn Button) Rand() Button { } // Set the URL for the button. Only for inline buttons. -func (btn Button) WithUrl(format string, v ...any) Button { - btn.Url = fmt.Sprintf(format, v...) +func (btn Button) WithURL(format string, v ...any) Button { + btn.URL = fmt.Sprintf(format, v...) return btn } @@ -107,10 +107,10 @@ func (btn Button) ToTelegramInline() apix.InlineKeyboardButton { ) } - if btn.Url != "" { + if btn.URL != "" { return apix.NewInlineKeyboardButtonURL( btn.Text, - btn.Url, + btn.URL, ) } diff --git a/cmd/test/start.go b/cmd/test/start.go index 367a15f..d52fd63 100644 --- a/cmd/test/start.go +++ b/cmd/test/start.go @@ -18,7 +18,7 @@ var StartWidget = tg.RenderFunc(func(c tg.Context) tg.UI { ).Inline( tg.NewKeyboard().Row( tg.Buttonf("TeleGopher surdeus.su page"). - WithUrl("https://surdeus.su/core/tg"), + WithURL("https://surdeus.su/core/tg"), ).Inline(), ),