-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
31 lines (25 loc) · 908 Bytes
/
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
import os
import asyncio
import discord
from discord.ext import commands
from discord.ext.commands.core import command
client = commands.Bot(command_prefix='!', intents=discord.Intents.all())
@client.event
async def on_ready():
await client.change_presence(status=discord.Status.idle, activity=discord.Activity(type=discord.ActivityType.listening, name="!help"))
print("Ready!")
async def main():
print("--- Loading Cogs ---")
for _, _, files in os.walk('cogs/'):
for file in files:
file_name, ext = os.path.splitext(file)
if file_name.startswith('cog'):
print(f"{file}")
await client.load_extension(f'cogs.{file_name}')
break
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
print("--- Done Loading Cogs ---")
# TODO: Enter discord API KEYs
client.run("")
loop.close()