Update warframe.py

This commit is contained in:
Emperor 2020-06-15 05:58:35 -04:00
parent a74eeb65b4
commit f29430bb04
No known key found for this signature in database
GPG Key ID: 725765E199BB6A5F

View File

@ -606,10 +606,20 @@ async def inv():
embed.set_thumbnail(url=invasion['defenderReward']['thumbnail'])
embed.set_footer(text=invasion['id'])
for i in servers:
try:
guild = bot.get_guild(i['serverid'])
except:
pass
content = ''
try:
role = discord.utils.get(guild.roles, name='Potato')
content+=' '+role.mention
except:
pass
try:
async with aiohttp.ClientSession() as session:
webhook = Webhook.from_url(i['giftinvasionswebhook'], adapter=AsyncWebhookAdapter(session))
await webhook.send(embed=embed)
await webhook.send(content=content, embed=embed)
except:
pass
else:
@ -628,10 +638,20 @@ async def inv():
embed.set_thumbnail(url=invasion['attackerReward']['thumbnail'])
embed.set_footer(text=invasion['id'])
for i in servers:
try:
guild = bot.get_guild(i['serverid'])
except:
pass
content = ''
try:
role = discord.utils.get(guild.roles, name='Potato')
content+=' '+role.mention
except:
pass
try:
async with aiohttp.ClientSession() as session:
webhook = Webhook.from_url(i['giftinvasionswebhook'], adapter=AsyncWebhookAdapter(session))
await webhook.send(embed=embed)
await webhook.send(content=content, embed=embed)
except:
pass
inva.append(invasion['id'])