diff options
| -rw-r--r-- | slack.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -15,11 +15,14 @@ def echo(): @app.route("/xkcd", methods=['POST']) def xkcd_view(): - title, url = get_xkcd(request.form['text']) + comic_id = request.form['text'] + title, url = get_xkcd(comic_id) d = {'response_type': 'in_channel', - 'text': title, 'attachments': [ - {'image_url':"http:{0}:".format(url)} + {'image_url':"http:{0}".format(url), + 'title': title, + 'title_link': 'http://www.xkcd.org/{0}'.format(comic_id) + } ] } return jsonify(d) |
