From f8367663d358b410b821d8cd34e2ac8ad449b8d9 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Sat, 7 Nov 2015 16:32:29 -0500 Subject: tentative fix --- slack.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'slack.py') diff --git a/slack.py b/slack.py index c6c9faf..e31061d 100644 --- a/slack.py +++ b/slack.py @@ -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) -- cgit v1.2.3-70-g09d2