forked from makayla-moster/HammerBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hammerbot.py
35 lines (27 loc) · 815 Bytes
/
hammerbot.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
# bot.py
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("DISCORD_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 AoE2 data")
await bot.change_presence(activity=game)
await load_cogs()
bot.run(TOKEN)