forked from Bi0force1/Bio-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
36 lines (30 loc) · 875 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
# Import required libraries
import discord
from discord.ext import commands
from discord.ui import Select
import os
import asyncio
#import modules
from config import TOKEN
# set common variables
intents = discord.Intents.all()
client = commands.Bot(command_prefix="!", intents=intents)
intents.message_content = True
intents.messages = True
intents.reactions = True
# 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)