updated tech stack for newer versions of python, removed pyaudio. refactored configuration into .env file and integration inside logic, removed repeat config reads
This commit is contained in:
13
main.py
13
main.py
@@ -3,6 +3,16 @@ from bot import Groovy
|
||||
import config
|
||||
import help
|
||||
|
||||
# Validate configuration before starting
|
||||
try:
|
||||
config.validate_config()
|
||||
config.print_config_info()
|
||||
except ValueError as e:
|
||||
print(f"❌ Configuration Error:\n{e}")
|
||||
print("\n💡 Tip: Copy .env.example to .env and fill in your values")
|
||||
exit(1)
|
||||
|
||||
# Initialize bot with validated config
|
||||
client = Groovy(command_prefix=config.get_prefix(), intents=discord.Intents.all())
|
||||
|
||||
@client.event
|
||||
@@ -25,4 +35,5 @@ async def on_voice_state_update(member, before, after):
|
||||
except Exception as e:
|
||||
print(f"Error auto-disconnecting: {e}")
|
||||
|
||||
client.run(config.get_login("live"))
|
||||
# Run bot with environment-appropriate token
|
||||
client.run(config.get_discord_token())
|
||||
|
||||
Reference in New Issue
Block a user