fix: fixed Url to URL to fit the standartization.

This commit is contained in:
Andrey Parhomenko 2024-07-23 23:43:26 +05:00
parent 2d5acbd112
commit 7a9a8be397
2 changed files with 6 additions and 6 deletions

View file

@ -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,
)
}

View file

@ -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(),
),