-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
36 lines (29 loc) · 1.15 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
import os
import discord
from discord import app_commands
from discord.ext import commands
from env.config import Config
config = Config()
TOKEN = config.token
class Bot(commands.Bot):
def __init__(self):
super().__init__(command_prefix="omg.admin ", intents=discord.Intents.all())
async def startup(self):
bot.owner_ids = [1178498830505885787]
await bot.wait_until_ready()
await bot.tree.sync()
await bot.change_presence(activity=discord.Game("Booting..."), status=discord.Status.dnd)
print('[INFO] Sucessfully synced applications commands')
print(f'[INFO] Connected as {bot.user}')
async def setup_hook(self):
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
try:
await bot.load_extension(f"cogs.{filename[:-3]}")
print(f"[INFO] Loaded {filename}")
except Exception as e:
print(f"[WARNING] Failed to load {filename}")
print(f"[ERROR] {e}")
self.loop.create_task(self.startup())
bot = Bot()
bot.run(TOKEN)