-
Clone the repo
-
Install rtmbot (ideally into a virtualenv)
pip install -r requirements.txt
-
Get the
secrets.py
and slack token from TG -
Change to the rtmbot/ directory and run 'run.py' to start the bot
-
Please do not test in the public channel. Use #testing-grounds or the Mr Meeseeks DM.
To add a plugin, copy the template.py
file in the plugins/
directory to a new file. Add that new plugin to the rtmbot.conf
file. Remember to change the name of the class from Template
to whatever you plugin is called
Plugins can send messages back to any channel or direct message. This is done by appending a two item array to the Plugin's output array (myPluginInstance.output
). The first item in the array is the channel or DM ID and the second is the message text. Example that writes "hello world" when the plugin is started:
class myPlugin(Plugin):
def process_message(self, data):
self.outputs.append(["C12345667", "hello world"])
Plugins also have access to the connected SlackClient instance for more complex output (or to fetch data you may need).
def process_message(self, data):
self.slack_client.api_call(
"chat.postMessage", channel="#general", text="Hello from Python! :tada:",
username="pybot", icon_emoji=":robot_face:"