Skip to content

Commit 0ac495d

Browse files
authored
feat: error handling for KeyboardInterrupt in start() (#853)
* feat: error handling for KeyboardInterrupt in `start()` * refactor: modify log message
1 parent 778c6db commit 0ac495d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

interactions/client/bot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ def start(self) -> None:
139139
self._loop.run_until_complete(self._ready())
140140
except (CancelledError, Exception) as e:
141141
raise e from e
142+
except KeyboardInterrupt:
143+
log.error("KeyboardInterrupt detected, shutting down the bot.")
142144

143145
def __register_events(self) -> None:
144146
"""Registers all raw gateway events to the known events."""

0 commit comments

Comments
 (0)