Documentation ¶
Index ¶
- type EventsHandler
- func (eh *EventsHandler) HandleDisconnectEvent(event *domain.DisconnectEvent) error
- func (eh *EventsHandler) HandleHelpEvent(event *domain.HelpEvent) error
- func (eh *EventsHandler) HandleLoginEvent(event *domain.LoginEvent) error
- func (eh *EventsHandler) HandleLogoutEvent(event *domain.LogoutEvent) error
- func (eh *EventsHandler) HandleRepeatedLoginEvent(event *domain.LoginEvent) error
- func (eh *EventsHandler) HandleReplyEvent(event *domain.ReplyEvent) error
- func (eh *EventsHandler) HandleStartEvent(event *domain.StartEvent) error
- func (eh *EventsHandler) HandleTextMessageEvent(event *domain.TextMessageEvent) error
- func (eh *EventsHandler) IsLoggedIn() bool
- type Opts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventsHandler ¶
type EventsHandler struct {
// contains filtered or unexported fields
}
EventsHandler represents entity that handles events from telegram and whatsapp event providers.
func NewEventsHandler ¶
func NewEventsHandler(log *zap.Logger, opts *Opts) *EventsHandler
NewEventsHandler creates new instance of EventsHandler.
func (*EventsHandler) HandleDisconnectEvent ¶ added in v0.2.0
func (eh *EventsHandler) HandleDisconnectEvent(event *domain.DisconnectEvent) error
HandleDisconnectEvent method handles disconnect event.
func (*EventsHandler) HandleHelpEvent ¶ added in v0.2.0
func (eh *EventsHandler) HandleHelpEvent(event *domain.HelpEvent) error
HandleHelpEvent method handles help event.
func (*EventsHandler) HandleLoginEvent ¶
func (eh *EventsHandler) HandleLoginEvent(event *domain.LoginEvent) error
HandleLoginEvent method handles login event.
func (*EventsHandler) HandleLogoutEvent ¶ added in v0.2.0
func (eh *EventsHandler) HandleLogoutEvent(event *domain.LogoutEvent) error
HandleLogoutEvent method handles repeated logout event.
func (*EventsHandler) HandleRepeatedLoginEvent ¶ added in v0.2.0
func (eh *EventsHandler) HandleRepeatedLoginEvent(event *domain.LoginEvent) error
HandleRepeatedLoginEvent method handles repeated login event.
func (*EventsHandler) HandleReplyEvent ¶
func (eh *EventsHandler) HandleReplyEvent(event *domain.ReplyEvent) error
HandleReplyEvent method handles reply event.
func (*EventsHandler) HandleStartEvent ¶
func (eh *EventsHandler) HandleStartEvent(event *domain.StartEvent) error
HandleStartEvent method handles start event.
func (*EventsHandler) HandleTextMessageEvent ¶
func (eh *EventsHandler) HandleTextMessageEvent(event *domain.TextMessageEvent) error
HandleTextMessageEvent method handles text message event.
func (*EventsHandler) IsLoggedIn ¶ added in v0.2.0
func (eh *EventsHandler) IsLoggedIn() bool
IsLoggedIn method returns `true` if client is authenticated in WhatsApp, otherwise returns `false`.
type Opts ¶
type Opts struct { // ChatID is telegram bot chat identifier. ChatID int64 // WhatsappProviderEvents is a channel to send events from whatsapp provider. WhatsappProviderEvents chan domain.Event // TelegramAPI is a client to interact with telegram API. TelegramAPI *tgbotapi.BotAPI }
Opts represents options to create new instance of EventsHandler.