Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Leviaria authored Jul 8, 2024
1 parent a9c3fbe commit f6e6459
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import threading
import time

from loguru import logger

from clashroyalebuildabot.actions.archers_action import ArchersAction
from clashroyalebuildabot.actions.giant_action import GiantAction
from clashroyalebuildabot.actions.goblin_barrel_action import (
Expand All @@ -18,6 +20,14 @@

start_time = datetime.now()

logger.remove()
logger.add(
sys.stderr,
format="{time} {level} {message}",
backtrace=False,
diagnose=False,
)


def update_terminal_title():
while True:
Expand All @@ -41,8 +51,12 @@ def main():
MinipekkaAction,
MusketeerAction,
}
bot = Bot(actions=actions)
bot.run()
try:
bot = Bot(actions=actions)
bot.run()
except Exception as e:
logger.error(f"An error occurred: {e}")
sys.exit(1)


if __name__ == "__main__":
Expand Down

0 comments on commit f6e6459

Please sign in to comment.