Documentation ¶
Index ¶
- type Service
- func (s *Service) AddAccount(ctx context.Context, account store.Account) error
- func (s *Service) ApplyConfigurationValues(context.Context, *twicmdcfgpb.ApplyRequest) (*twicmdcfgpb.ApplyResponse, error)
- func (s *Service) ConfigurationValues(ctx context.Context, req *twicmdcfgpb.OptionsRequest) (*twicmdcfgpb.OptionsResponse, error)
- func (s *Service) Execute(ctx context.Context, req *twicmdproto.ExecuteRequest) (*twicmdproto.ExecuteResponse, error)
- func (s *Service) Name() string
- func (s *Service) SendMessage(ctx context.Context, msg *twismsproto.Message) error
- func (s *Service) SendingNumber() (string, float64)
- func (s *Service) Service(ctx context.Context) (*twicmdproto.Service, error)
- func (s *Service) Start(ctx context.Context) error
- func (s *Service) SubscribeMessages(ch chan<- *twismsproto.Message, filters *twismsproto.MessageFilters)
- func (s *Service) UnsubscribeMessages(ch chan<- *twismsproto.Message)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the main handler that binds Twipi and Discord.
func NewService ¶
NewService creates a new handler with the given twipi server and config.
func (*Service) AddAccount ¶
AddAccount adds an account to the handler. It blocks until the account is added. [Start] must be called before this function.
func (*Service) ApplyConfigurationValues ¶
func (s *Service) ApplyConfigurationValues(context.Context, *twicmdcfgpb.ApplyRequest) (*twicmdcfgpb.ApplyResponse, error)
ApplyConfigurationValues implements twicmd.ConfigurableService.
func (*Service) ConfigurationValues ¶
func (s *Service) ConfigurationValues(ctx context.Context, req *twicmdcfgpb.OptionsRequest) (*twicmdcfgpb.OptionsResponse, error)
ConfigurationValues implements twicmd.ConfigurableService.
func (*Service) Execute ¶
func (s *Service) Execute(ctx context.Context, req *twicmdproto.ExecuteRequest) (*twicmdproto.ExecuteResponse, error)
Execute implements twicmd.Service.
func (*Service) SendMessage ¶
SendMessage sends a message through the Service's message channel. Messages sent here will go through the MessageSubscriber.
func (*Service) SendingNumber ¶
func (*Service) Service ¶
Service implements twicmd.Service.
func (*Service) SubscribeMessages ¶
func (s *Service) SubscribeMessages(ch chan<- *twismsproto.Message, filters *twismsproto.MessageFilters)
SubscribeMessages implements twisms.MessageSubscriber.
func (*Service) UnsubscribeMessages ¶
func (s *Service) UnsubscribeMessages(ch chan<- *twismsproto.Message)
UnsubscribeMessages implements twisms.MessageSubscriber.