PhotoOptions and VideoOptions

This commit is contained in:
nefrace 2023-02-13 01:39:57 +03:00
parent c6ce1913dc
commit b7f1e3e9ed
2 changed files with 35 additions and 1 deletions

View File

@ -1,8 +1,11 @@
package nechotron
import "strings"
import (
"strings"
)
type FilterFn func(u *Update) bool
type FilteredValue interface{}
func TextStartsWith(text string) FilterFn {
return func(u *Update) bool {

View File

@ -84,3 +84,34 @@ func (o *OptionsBuilder) MessageOptions() *echotron.MessageOptions {
AllowSendingWithoutReply: o.allowSendingWithoutReply,
}
}
func (o *OptionsBuilder) PhotoOptions() *echotron.PhotoOptions {
return &echotron.PhotoOptions{
ReplyMarkup: o.replyMarkup,
ParseMode: o.parseMode,
Caption: o.caption,
CaptionEntities: o.entities,
MessageThreadID: int(o.messageThreadID),
ReplyToMessageID: o.replyToMessageID,
HasSpoiler: o.hasSpoiler,
DisableNotification: o.disableNotification,
ProtectContent: o.protectContent,
AllowSendingWithoutReply: o.allowSendingWithoutReply,
}
}
func (o *OptionsBuilder) VideoOptions() *echotron.VideoOptions {
return &echotron.VideoOptions{
ReplyMarkup: o.replyMarkup,
ParseMode: o.parseMode,
Caption: o.caption,
CaptionEntities: o.entities,
SupportsStreaming: true,
MessageThreadID: int(o.messageThreadID),
ReplyToMessageID: o.replyToMessageID,
HasSpoiler: o.hasSpoiler,
DisableNotification: o.disableNotification,
ProtectContent: o.protectContent,
AllowSendingWithoutReply: o.allowSendingWithoutReply,
}
}