mirror of
https://github.com/insertapp/mmolbbot.git
synced 2025-08-01 18:53:33 +00:00
chroe: calculate timing
This commit is contained in:
parent
15c5c2c50a
commit
c77964c255
1 changed files with 5 additions and 0 deletions
|
@ -517,6 +517,11 @@ class liveupdate(commands.Cog):
|
|||
finalstr = "Last 12 timings:"
|
||||
for i in timings:
|
||||
finalstr += f"\n{i}s"
|
||||
interval = round((sum(timings)/len(timings)),3)
|
||||
if interval < 5:
|
||||
interval = 5
|
||||
finalstr += f"\nNew interval: {interval}"
|
||||
self.updatelivegames.change_interval(seconds=interval)
|
||||
await warning.send(finalstr)
|
||||
timings.clear()
|
||||
except Exception as e:
|
||||
|
|
Loading…
Reference in a new issue