python-zulip-api/bots/feedback-bot
Tim Abbott db0a064c80 Bots: Send messages through staging.humbughq.com.
(imported from commit d9859bfe5f5b3b7c5efa5ef930d6cfaa5c0d1fc2)
2012-11-06 16:59:28 -05:00

27 lines
1,015 B
Python
Executable file

#!/usr/bin/python
import sys
import os
import optparse
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
import api.common
prod_client = api.common.HumbugAPI(email="feedback@humbughq.com",
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
verbose=True,
site="https://humbughq.com")
staging_client = api.common.HumbugAPI(email="feedback@humbughq.com",
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
verbose=True,
site="https://staging.humbughq.com")
def forward_message(message):
forwarded_message = {
"type": "stream",
"stream": "support",
"subject": "feedback from %s" % message["sender_email"],
"content": message["content"],
}
staging_client.send_message(forwarded_message)
prod_client.call_on_each_message(forward_message)