Pull #1

Merged
Yuuki merged 3 commits from Raiza.dev/EliteBot:master into master 2024-02-22 12:30:17 +01:00
2 changed files with 39 additions and 0 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@ logs
test.json
elitebot
.idea
venv

38
elitebot.py Normal file
View file

@ -0,0 +1,38 @@
#!/usr/bin/env python3
import asyncio
import sys
from src.bot import Bot
def main():
if len(sys.argv) < 2:
print('Usage: python elitebot.py <config_file>')
sys.exit(1)
config_file = sys.argv[1]
try:
bot = Bot(config_file)
except FileNotFoundError as e:
print(f'Config file not found: {e}')
sys.exit(1)
except Exception as e:
print(f'Error loading bot: {e}')
sys.exit(1)
try:
print('EliteBot started successfully!')
asyncio.run(bot.start())
except Exception as e:
print(f'Error starting EliteBot: {e}')
sys.exit(1)
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
print('\nEliteBot has been stopped.')
except Exception as e:
print(f'An unexpected error occurred: {e}')