-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
34 lines (23 loc) · 839 Bytes
/
main.py
File metadata and controls
34 lines (23 loc) · 839 Bytes
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
import discord
from discord.ext import commands
import os
from config import *
class MyBot(commands.Bot):
def __init__(self,*args,**kwargs):
super().__init__(*args,**kwargs)
async def on_ready(self):
# Slash Command Sync
synced =await bot.tree.sync()
print(f"Synced: {len(synced)}")
print(f"Bot Online: {bot.user} , {bot.user.id}")
# Cog Load
async def setup_hook(self):
for filename in os.listdir('cogs'):
if filename.endswith(".py"):
await self.load_extension(f"cogs.{filename[:-3]}")
print(f"Cog Loaded: {filename[:-3]}")
else:
print(f'Failed to load cog {filename}')
bot = MyBot(command_prefix=prefix,intents=discord.Intents.all())
# Bot Run
bot.run(token)