Documentation ¶
Index ¶
- type Robot
- func (bot *Robot) CreateImageMessage(content interface{}) (*model.Message, error)
- func (bot *Robot) CreateMessage(messageType model.MessageType, content interface{}) (*model.Message, error)
- func (bot *Robot) CreateTextMessage(content interface{}) (*model.Message, error)
- func (bot *Robot) IsAwaken(ctx context.Context) error
- func (bot *Robot) Receive(ctx context.Context)
- func (bot *Robot) Send(ctx context.Context, jobType int, message *model.Message) (*model.Job, error)
- func (bot *Robot) SetErrorHandler(handle model.HandleError)
- func (bot *Robot) SetMessagePreHandler(handles ...model.HandlePreSend)
- func (bot *Robot) SetPostMessageHandler(handles ...model.HandlePostReply)
- func (bot *Robot) Start(ctx context.Context) error
- func (bot *Robot) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Robot ¶
type Robot struct { *model.RobotAttributes // components Queue queue2.QueueInterface Logger *logger.Logger // Middlewares ErrorHandler model.HandleError PreMessageHandlers []model.HandlePreSend PostMessageHandlers []model.HandlePostReply // functional IsWorking bool Mutex sync.Mutex ErrorChan chan *model.ErrReply // webhook NotifyUrl string }
func (*Robot) CreateImageMessage ¶
func (*Robot) CreateMessage ¶
func (*Robot) CreateTextMessage ¶
func (*Robot) SetErrorHandler ¶
func (bot *Robot) SetErrorHandler(handle model.HandleError)
func (*Robot) SetMessagePreHandler ¶
func (bot *Robot) SetMessagePreHandler(handles ...model.HandlePreSend)
func (*Robot) SetPostMessageHandler ¶
func (bot *Robot) SetPostMessageHandler(handles ...model.HandlePostReply)
Click to show internal directories.
Click to hide internal directories.