Scripts for guild notifications using Discord Webhooks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
623 B

#! /usr/bin/python3
Affixes Cron
import requests
import webhook
import conf
wh = webhook.Webhook(conf.url_discord_webhook_news)
rio_api = ""
api = requests.get(url=rio_api).json()
if api is not None and "affix_details" in api:
fields = []
for d in api["affix_details"]:
name = d["name"]
fields.append(webhook.field("{1} {0}".format(name, conf.affixes[name]), conf.affix_human[name], True))
wh.add_embed(webhook.embed(color=0x3f89ff, fields=fields))
wh.send("**[Affixes de esta semana](<>)**")