-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
37 lines (31 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
32
33
34
35
36
37
# Import required libraries
import discord
from discord.ext import commands
from discord.ui import Select
import os
import asyncio
from dotenv import load_dotenv
# set common variables
intents = discord.Intents.all()
client = commands.Bot(command_prefix="!", intents=intents)
load_dotenv()
intents.message_content = True
intents.messages = True
intents.reactions = True
token = os.environ["TOKEN"]
# Run bot on discord
@client.event
async def on_ready():
print("Fuck it, we'll do it live...")
@client.event
async def load_extensions():
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
await client.load_extension(f'cogs.{filename[:-3]}')
print(f"Loaded Cog: {filename[:-3]}")
async def main():
async with client:
await load_extensions()
await client.start(token)
asyncio.run(main())
client.run(token)