2017-07-10 08:58:51 +00:00
|
|
|
#! /usr/bin/python3
|
2017-12-13 11:37:31 +00:00
|
|
|
"""
|
|
|
|
Affixes Cron
|
|
|
|
"""
|
2017-07-10 08:58:51 +00:00
|
|
|
|
|
|
|
import datetime
|
|
|
|
import webhook
|
|
|
|
import conf
|
|
|
|
|
2017-08-31 15:21:23 +00:00
|
|
|
wh = webhook.Webhook(conf.url_discord_webhook_news)
|
2017-07-10 08:58:51 +00:00
|
|
|
|
|
|
|
week = (int(datetime.datetime.now().strftime("%V")) % len(conf.affix_rotation)) - 1
|
|
|
|
|
|
|
|
f = []
|
|
|
|
for s in conf.affix_rotation[week]:
|
2017-12-13 11:37:31 +00:00
|
|
|
f.append(webhook.field("{1} {0}".format(s, conf.affixes[s]), conf.affix_human[s], True))
|
2017-07-10 08:58:51 +00:00
|
|
|
|
|
|
|
wh.add_embed(webhook.embed(color=0x3f89ff, fields=f))
|
|
|
|
wh.send("**[Affixes de esta semana](<https://mythicpl.us/>)**")
|