Documentation ¶
Index ¶
- Constants
- func BotActivator() *di.Activator
- func SubActivator() *di.Activator
- type Bot
- type BotKey
- type Config
- type Dict
- type List
- func (l *List[T]) Add(item T)
- func (l *List[T]) Del(i int, j int)
- func (l *List[T]) Get(i int) T
- func (l *List[T]) Insert(i int, item T)
- func (l *List[T]) IsEmpty() bool
- func (l *List[T]) Len() int
- func (l *List[T]) Loop(fn func(i int, item T) bool)
- func (l *List[T]) Shift() T
- func (l *List[T]) Unshift(item T)
- type Message
- type SubKey
- type Subscriber
- type View
Constants ¶
View Source
const ( OpUnmarshalMessage errs.Op = "telegram sub: unmarshal message" OpPrepareMessage errs.Op = "telegram sub: prepare message" OpUnmarshalArticles errs.Op = "telegram sub: unmarshal articles" OpFindSite errs.Op = "telegram sub: find site" OpFindChats errs.Op = "telegram sub: find chats" OpProcessor errs.Op = "telegram sub: processor" )
View Source
const ConfigKey = "telegram"
Variables ¶
This section is empty.
Functions ¶
func BotActivator ¶
func SubActivator ¶
Types ¶
type Config ¶
type Message ¶
type Message struct { ChatID int64 `json:"chat_id,omitempty"` ImageURL string `json:"image_url,omitempty"` View View `json:"view,omitempty"` Data any `json:"data,omitempty"` Delay bool `json:"delay,omitempty"` }
func (*Message) UnmarshalJSON ¶
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func NewSubscriber ¶
func NewSubscriber( bot *Bot, sub *pubsub.Subscriber, siteRepo repository.ReadRepository[*entity.Site], chatRepo repository.ReadRepository[*entity.Chat], ) *Subscriber
type View ¶
type View string
const ( ViewAppStart View = "appstart.html" ViewAppStop View = "appstop.html" ViewArticles View = "articles.html" ViewArticle View = "article.html" ViewChat View = "chat.html" ViewSites View = "sites.html" ViewSub View = "sub.html" ViewSuccess View = "success.html" ViewError View = "error.html" ViewNotFound View = "notfound.html" OpBotNew errs.Op = "bot: new" OpBotSend errs.Op = "bot: send" )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.