Skip to content

Commit

Permalink
Merge pull request #178 from zediious/0.5.2
Browse files Browse the repository at this point in the history
Changes for 0.5.2
  • Loading branch information
zediious authored Jun 9, 2024
2 parents 7c22498 + 31f659d commit da14714
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions raptorWeb/raptorbot/botware.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,19 @@ def is_safe_to_start():
Return true if it has been one minute since the bot last stopped.
"""
bot_stats = DiscordBotInternal.objects.get_or_create(name="botinternal-stat")[0]
minutes_since_stop = int(str(
(localtime() - bot_stats.time_last_stopped.astimezone())
).split(":")[1])

if minutes_since_stop > 1:
try:
minutes_since_stop = int(str(
(localtime() - bot_stats.time_last_stopped.astimezone())
).split(":")[1])

if minutes_since_stop > 1:
return True

return False

except AttributeError:
return True

return False

def start_bot_process():
"""
Expand Down

0 comments on commit da14714

Please sign in to comment.