Fix time for job
This commit is contained in:
parent
294721f588
commit
b5316f6877
@ -11,8 +11,10 @@ import tarkov
|
||||
|
||||
if os.getenv("DRAGON_ENV") == "prod":
|
||||
channel_id = 815310511776202773
|
||||
time_limit = 600
|
||||
else:
|
||||
channel_id = 932476007439552522
|
||||
time_limit = 10
|
||||
|
||||
|
||||
class Tarkov(commands.Cog):
|
||||
@ -22,7 +24,7 @@ class Tarkov(commands.Cog):
|
||||
|
||||
tarkov = discord.SlashCommandGroup("tarkov", "Tarkov related commands")
|
||||
|
||||
@tasks.loop(seconds=10)
|
||||
@tasks.loop(seconds=time_limit)
|
||||
async def check_boss_spawns(self):
|
||||
# Wait until the bot is ready before we actually start executing code
|
||||
await self.bot.wait_until_ready()
|
||||
@ -31,9 +33,9 @@ class Tarkov(commands.Cog):
|
||||
|
||||
if os.path.exists("/tmp/boss_spawns.txt"):
|
||||
|
||||
spawn_data = eval(open("/tmp/boss_spawns.txt", "r").read())
|
||||
known_spawns = eval(open("/tmp/boss_spawns.txt", "r").read())
|
||||
|
||||
if most_recent_spawns != spawn_data:
|
||||
if most_recent_spawns != known_spawns:
|
||||
print("Boss spawns have changed")
|
||||
|
||||
embed = discord.Embed(
|
||||
@ -49,12 +51,12 @@ class Tarkov(commands.Cog):
|
||||
inline=False,
|
||||
)
|
||||
|
||||
open("/tmp/boss_spawns.txt", "w").write(str(levels))
|
||||
open("/tmp/boss_spawns.txt", "w").write(str(most_recent_spawns))
|
||||
|
||||
await self.bot.get_channel(channel_id).send(embed=embed)
|
||||
|
||||
else:
|
||||
open("/tmp/boss_spawns.txt", "w").write(str(levels))
|
||||
open("/tmp/boss_spawns.txt", "w").write(str(most_recent_spawns))
|
||||
|
||||
async def get_all_bosses(ctx: discord.AutocompleteContext):
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user