-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
31 lines (26 loc) · 805 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 asyncio
import logging
import os
import random
import aiohttp
import discord
from discord.ext import commands, tasks
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv("BOT_TOKEN")
intents=discord.Intents.all()
bot = commands.Bot(intents=intents, command_prefix="!")
logging.basicConfig(level=logging.INFO)
async def load_cogs():
for folder in os.listdir("cog_modules"):
if os.path.exists(os.path.join("cog_modules", folder, "cog.py")):
await bot.load_extension(f"cog_modules.{folder}.cog")
print(f"{folder} cog loaded!")
else:
print(f"{folder} cog NOT loaded!")
@bot.event
async def on_ready():
game = discord.Game("with Scratch blocks")
await bot.change_presence(activity=game)
await load_cogs()
bot.run(TOKEN)