Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
joe/events.go
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
32 lines (27 sloc)
1.3 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package joe | |
// The InitEvent is the first event that is handled by the Brain after the Bot | |
// is started via Bot.Run(). | |
type InitEvent struct{} | |
// The ShutdownEvent is the last event that is handled by the Brain before it | |
// stops handling any events after the bot context is done. | |
type ShutdownEvent struct{} | |
// The ReceiveMessageEvent is typically emitted by an Adapter when the Bot sees | |
// a new message from the chat. | |
type ReceiveMessageEvent struct { | |
ID string // The ID of the message, identifying it at least uniquely within the Channel | |
Text string // The message text. | |
AuthorID string // A string identifying the author of the message on the adapter. | |
Channel string // The channel over which the message was received. | |
// A message may optionally also contain additional information that was | |
// received by the Adapter (e.g. with the slack adapter this may be the | |
// *slack.MessageEvent. Each Adapter implementation should document if and | |
// what information is available here, if any at all. | |
Data interface{} | |
} | |
// The UserTypingEvent is emitted by the Adapter and indicates that the Bot | |
// sees that a user is typing. This event may not be emitted on all Adapter | |
// implementations but only when it is actually supported (e.g. on slack). | |
type UserTypingEvent struct { | |
User User | |
Channel string | |
} |