-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
28 lines (21 loc) · 757 Bytes
/
main.py
File metadata and controls
28 lines (21 loc) · 757 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
import asyncio
import discord
import os
from discord.ext import commands
from dotenv import load_dotenv
load_dotenv()
client = commands.Bot(command_prefix='!', help_command=None, intents=discord.Intents().all())
client.remove_command('help')
async def load_commands(client):
for filename in os.listdir('./Commands'):
if filename.endswith('.py'):
await client.load_extension(f'Commands.{filename[: -3]}')
async def load_events(client):
for filename in os.listdir('./Events'):
if filename.endswith('.py'):
await client.load_extension(f'Events.{filename[: -3]}')
async def main():
await load_events(client)
await load_commands(client)
await client.start(os.getenv('token'))
asyncio.run(main())