-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
34 lines (27 loc) · 838 Bytes
/
bot.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
import discord
import asyncio
from dotenv import load_dotenv
from discord.ext.commands import Bot
load_dotenv()
initial_extensions = (
'cogs.storage',
'cogs.calendar',
'cogs.emoji',
'cogs.utility',
'cogs.economy',
)
class CactusBot(Bot):
def __init__(self):
# craft intents
intents = discord.Intents.default()
intents.message_content = True
super().__init__(command_prefix='$', intents=intents)
# load extensions
asyncio.run(self.load_extensions())
async def load_extensions(self):
for extension in initial_extensions:
try:
await self.load_extension(extension)
print(f'Loaded extension {extension}.')
except Exception as e:
print(f'Failed to load extension {extension}.')