-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
38 lines (26 loc) · 826 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import asyncio
import os
import discord
from dotenv import load_dotenv
from discord.ext import commands
from bot.elevenlabs_utils import set_api_key
load_dotenv()
set_api_key(os.getenv('API_KEY'))
intents = discord.Intents.default()
bot = commands.Bot(command_prefix='?', intents=intents)
discord.utils.setup_logging()
@bot.event
async def on_ready():
print(f'Logged in as {bot.user} (ID: {bot.user.id})')
print('------')
await bot.tree.sync()
async def load_extensions():
for filename in os.listdir("./bot/cogs"):
if filename.endswith(".py") and filename != "__init__.py":
await bot.load_extension(f"bot.cogs.{filename[:-3]}")
# Load cogs
async def main():
async with bot:
await load_extensions()
await bot.start(os.getenv('BOT_TOKEN'))
asyncio.run(main())