diff --git a/button.go b/button.go index bd181b5..6d7fb4e 100644 --- a/button.go +++ b/button.go @@ -49,8 +49,8 @@ func (btn *Button) Rand() *Button { } // Set the URL for the button. Only for inline buttons. -func (btn *Button) WithUrl(url string) *Button { - btn.Url = url +func (btn *Button) WithUrl(format string, v ...any) *Button { + btn.Url = fmt.Sprintf(format, v...) return btn } diff --git a/inline.go b/inline.go index f666a5b..fac96db 100644 --- a/inline.go +++ b/inline.go @@ -49,8 +49,7 @@ func (compo *InlineCompo) Update(c *Context) { var edit tgbotapi.Chattable markup := compo.Inline.ToApi() ln := len(markup.InlineKeyboard) - c.Sendf("%d shit", ln) - if ln == 0 { + if ln == 0 || compo.Inline.Rows == nil { edit = tgbotapi.NewEditMessageText( c.Session.Id.ToApi(), compo.Message.MessageID, diff --git a/message.go b/message.go index 2cf0b9b..68f76ad 100644 --- a/message.go +++ b/message.go @@ -36,6 +36,12 @@ func (compo *MessageCompo) Update(c *Context) { compo.Message = &msg } +func (compo *MessageCompo) Delete(c *Context) { + cfg := tgbotapi.NewDeleteMessage(c.Session.Id.ToApi(), compo.Message.MessageID) + c.Bot.Api.Send(cfg) + //c.Sendf("%q", err) +} + // Is only implemented to make it sendable and so we can put it // return of rendering functions. func (compo *MessageCompo) SetMessage(msg *Message) {