diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2015-11-07 16:32:29 -0500 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2015-11-07 17:06:11 -0500 |
| commit | f8367663d358b410b821d8cd34e2ac8ad449b8d9 (patch) | |
| tree | c771b3d826976e9240f2c56e1aec826dd999815e | |
| parent | f039016ad17cc13a68e7ee96c50168967acabeba (diff) | |
| download | slack-f8367663d358b410b821d8cd34e2ac8ad449b8d9.tar.gz | |
tentative fix
| -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) |
