feat: ...
This commit is contained in:
parent
97b1bec13b
commit
ae2da1201c
3 changed files with 9 additions and 4 deletions
|
@ -49,8 +49,8 @@ func (btn *Button) Rand() *Button {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the URL for the button. Only for inline buttons.
|
// Set the URL for the button. Only for inline buttons.
|
||||||
func (btn *Button) WithUrl(url string) *Button {
|
func (btn *Button) WithUrl(format string, v ...any) *Button {
|
||||||
btn.Url = url
|
btn.Url = fmt.Sprintf(format, v...)
|
||||||
return btn
|
return btn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,7 @@ func (compo *InlineCompo) Update(c *Context) {
|
||||||
var edit tgbotapi.Chattable
|
var edit tgbotapi.Chattable
|
||||||
markup := compo.Inline.ToApi()
|
markup := compo.Inline.ToApi()
|
||||||
ln := len(markup.InlineKeyboard)
|
ln := len(markup.InlineKeyboard)
|
||||||
c.Sendf("%d shit", ln)
|
if ln == 0 || compo.Inline.Rows == nil {
|
||||||
if ln == 0 {
|
|
||||||
edit = tgbotapi.NewEditMessageText(
|
edit = tgbotapi.NewEditMessageText(
|
||||||
c.Session.Id.ToApi(),
|
c.Session.Id.ToApi(),
|
||||||
compo.Message.MessageID,
|
compo.Message.MessageID,
|
||||||
|
|
|
@ -36,6 +36,12 @@ func (compo *MessageCompo) Update(c *Context) {
|
||||||
compo.Message = &msg
|
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
|
// Is only implemented to make it sendable and so we can put it
|
||||||
// return of rendering functions.
|
// return of rendering functions.
|
||||||
func (compo *MessageCompo) SetMessage(msg *Message) {
|
func (compo *MessageCompo) SetMessage(msg *Message) {
|
||||||
|
|
Loading…
Reference in a new issue