Skip to content

Commit ad17fc0

Browse files
committed
BUGFIX:
- Exception on onPlayerStart, if the bot could not calculate the restart time
1 parent 1847a6a commit ad17fc0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugins/scheduler/listener.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ async def onPlayerStart(self, server: Server, data: dict) -> None:
173173
return
174174
action = self.get_config(server).get('action')
175175
if action:
176-
restart_in, rconf = self.get_next_restart(server, action)
176+
result = self.get_next_restart(server, action)
177177
# do not print any chat message when the server is set to restart on populated = False
178-
if not rconf.get('populated', True):
178+
if not result or not result[1].get('populated', True):
179179
return
180-
restart_time = f"in {utils.format_time(restart_in)}"
180+
restart_time = f"in {utils.format_time(result[0])}"
181181
elif server.restart_pending:
182182
restart_time = 'soon!'
183183
else:

0 commit comments

Comments
 (0)