-
Notifications
You must be signed in to change notification settings - Fork 16
Message Handlers
Message handlers are used for simple message routing.
To use them you need to add “rapidsms.contrib.handlers” to your list of INSTALLED_APPS in settings.py
Then in your own app’s directory create a folder named “handlers” and put any handlers there, extending a Handler base class.
The most common type of handler is the keyword handler. The handler app will route messages to your KeywordHandler based on the keyword (or list of keywords) you define in the handler. The help() method is called when you receive just the keyword but no text. The handle() method is called if there was a keyword + additional text. The text that is passed to the method already has the keyword stripped off. Additionally, the full message object will be available as a .msg property on the handler in your handle methods.