@@ -0,0 +1,835 @@
+# Connect to Slack%0A%0Aimport quark_twisted_runtime%0Aimport slack%0A%0A%0Aclass Handler(object):%0A%0A    def onHello(self, greeting):%0A        print %22Hello received:%22, greeting%0A%0A    def onSlackError(self, error):%0A        print %22Error:%22, error.code, error.text%0A%0A    def onSlackEvent(self, event):%0A        print %22Event:%22, event%0A%0A    def onMessage(self, message):%0A        print %22Received:%22, message.text%0A        if message.text and %22quark%22 in message.text:%0A            message.channel.send(%22quarkbot.py is excited about %22 + message.text)%0A%0A%0Adef main():%0A    # you need to go to https://api.slack.com/web and generate an access token%0A    token = %22*replace-me*%22%0A%0A    runtime = quark_twisted_runtime.get_twisted_runtime()%0A    client = slack.Client(runtime, token, Handler())%0A    client.connect()%0A    runtime.launch()%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add Slack bot in Python