-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
26 lines (20 loc) · 703 Bytes
/
main.py
File metadata and controls
26 lines (20 loc) · 703 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
import discord
from discord.ext import commands
from config import DISCORD_TOKEN
import os
from utils.http_server import start_http_server
class MyBot(commands.Bot):
async def setup_hook(self):
# Automatically load cogs
for filename in os.listdir("./cogs"):
if filename.endswith(".py") and filename != "__init__.py":
await self.load_extension(f"cogs.{filename[:-3]}")
await self.tree.sync()
intents = discord.Intents.default()
intents.message_content = True
bot = MyBot(command_prefix="!", intents=intents)
@bot.event
async def on_ready():
print(f"Logged in as {bot.user} (ID: {bot.user.id})")
start_http_server()
bot.run(DISCORD_TOKEN)