-
Notifications
You must be signed in to change notification settings - Fork 27
/
main.py
50 lines (39 loc) · 1.12 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
import asyncio
import itertools
import json
import os
import discord
import dotenv
from discord.ext import commands
from client import Client, get_prefix
dotenv.load_dotenv(".env")
with open("config.json", "r") as file:
config = json.load(file)
EXTENSION_PATHS = config["extension_paths"]
HANDLER_PATHS = config["handler_paths"]
DATABASE_PATHS = config["database_paths"]
# Change TEST_GUILD_ID to your guild in ./.env if you're working on BB.Bot's development
TEST_GUILD_ID = int(os.getenv("TEST_GUILD_ID"))
intents = discord.Intents.all()
status = itertools.cycle(["❓ ~help", "🎵 ~play", "📢 ~twitch"])
client = Client(
status,
EXTENSION_PATHS,
HANDLER_PATHS,
DATABASE_PATHS,
TEST_GUILD_ID,
command_prefix=get_prefix,
intents=intents,
case_insensitive=True,
)
# Load the client, sync slash commands and start an aiohttp session
async def main():
"""
Entry point of the application.
"""
async with client:
await client.load()
client.loop.create_task(client.sync())
TOKEN = os.getenv("TOKEN")
await client.start(TOKEN)
asyncio.run(main())