-
Notifications
You must be signed in to change notification settings - Fork 0
Adding support for a new chat program
AutoBot supports HipChat and Skype chat programs out-of-the-box, but you can add support for additional chat programs using three simple interfaces:
-
IChatSession - The core logic for communicating with the chat program should be implemented here. When the session receives a message from the client it raises an "OnMessageReceived" event which the core AutoBot attaches a handler to and sends the message to the appropriate command handler for processing.
-
IChatMessage - This is a simple wrapper for the text of the message received from the chat client. It has two properties that represent the original message text and a pre-processed version of the message text. The pre-processed version is useful if the session needs to remove any protocol "dressing" (e.g. "@AutoBot" in HipChat) before passing the message to the message handler.
-
IChatResponse - This represents a response channel that can be used to send messages back to the chat client. It implements a single method "Write(string text)" which is used by the message handler. Implementations will normally also need to store some routing information in private properties - for example the session, room name and the id of the person to reply to in HipChat. The Write method can then use this information to direct the response text to the appropriate person.