aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar z411 2019-03-29 11:06:40 -0300
committerLibravatar z411 2019-03-29 11:06:40 -0300
commitcb6cb9cda955d3507cb71a9e146443fb8af53136 (patch)
tree5748e0487413a0d3fe7f286397a56c1920f7f5ef
parentcbcec8cdc72261fda3784cf629cbbf98ebdea93d (diff)
downloadweabot-cb6cb9cda955d3507cb71a9e146443fb8af53136.tar.gz
weabot-cb6cb9cda955d3507cb71a9e146443fb8af53136.tar.xz
weabot-cb6cb9cda955d3507cb71a9e146443fb8af53136.zip
Parametrizado hook de Discord.
-rw-r--r--cgi/post.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cgi/post.py b/cgi/post.py
index 2c14004..4d4c598 100644
--- a/cgi/post.py
+++ b/cgi/post.py
@@ -1242,19 +1242,19 @@ def discord_hook(post, url):
"embeds": [{
"title": post['subject'],
"description": cut_home_msg(post['message'], 30),
- "url": "https://bienvenidoainternet.org" + url,
+ "url": "https://bienvenidoainternet.org" + url, # TODO: Parametrizar.
"color": 11910504,
"timestamp": datetime.datetime.utcfromtimestamp(post['timestamp']).isoformat(),
"footer": { "text": board['name'] },
- "thumbnail": { "url": "https://bienvenidoainternet.org/%s/thumb/%s" % (board['dir'], post['thumb']) },
+ "thumbnail": { "url": "%s%s/thumb/%s" % (Settings.HOME_URL, board['dir'], post['thumb']) },
"author": {
"name": "Nuevo hilo",
- "icon_url": "https://bienvenidoainternet.org/0/junk/w/shobon.gif"
+ "icon_url": "%s0/junk/w/shobon.gif" % Settings.HOME_URL
}}]
}
jsondata = json.dumps(data, separators=(',',':'))
opener = urllib2.build_opener()
opener.addheaders = [('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0')]
- response = opener.open(WEBHOOK_URL, jsondata, 6)
+ response = opener.open(Settings.DISCORD_HOOK_URL, jsondata, 6)
the_page = response.read()