Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.py #211

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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