First pass at boss spawn monitoring
This commit is contained in:
parent
74729a101f
commit
5d8d96213b
@ -27,20 +27,20 @@ class Tarkov(commands.Cog):
|
|||||||
# Wait until the bot is ready before we actually start executing code
|
# Wait until the bot is ready before we actually start executing code
|
||||||
await self.bot.wait_until_ready()
|
await self.bot.wait_until_ready()
|
||||||
|
|
||||||
levels = tarkov.tarkov_boss_info()
|
most_recent_spawns = tarkov.tarkov_boss_info()
|
||||||
|
|
||||||
if os.path.exists("/tmp/boss_spawns.txt"):
|
if os.path.exists("/tmp/boss_spawns.txt"):
|
||||||
|
|
||||||
current_spawns = eval(open("/tmp/boss_spawns.txt", "r").read())
|
spawn_data = eval(open("/tmp/boss_spawns.txt", "r").read())
|
||||||
|
|
||||||
if levels != current_spawns:
|
if most_recent_spawns != spawn_data:
|
||||||
print("Boss spawns have changed")
|
print("Boss spawns have changed")
|
||||||
|
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
description="-------", color=discord.Color.blue(), type="rich"
|
description="-------", color=discord.Color.blue(), type="rich"
|
||||||
)
|
)
|
||||||
embed.set_author(name="🎲 Boss Spawns have updated 🎲")
|
embed.set_author(name="🎲 Boss Spawns have updated 🎲")
|
||||||
for key, value in current_spawns.items():
|
for key, value in most_recent_spawns.items():
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name=key,
|
name=key,
|
||||||
value="\n".join(
|
value="\n".join(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user