-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
55 lines (46 loc) · 1.52 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
import asyncio
# Load the .env file
load_dotenv()
TOKEN = os.getenv('BOT_TOKEN')
# Configure the intents
intents = discord.Intents.default()
intents.message_content = True
intents.guilds = True
intents.guild_messages = True
intents.members = True
# Create the bot with a command prefix
bot = commands.Bot(command_prefix='+', intents=intents)
# Define an asynchronous setup function
async def setup_extensions():
await bot.load_extension('cogs.moderation')
await bot.load_extension('cogs.reactions')
await bot.load_extension('cogs.spam')
await bot.load_extension('cogs.logging')
await bot.load_extension('cogs.test')
@bot.event
async def on_ready():
print("\033[91m" + r"""
__________ _________________________ ________________
\______ \ / _ \__ ___/\_ ___ \ / _ \__ ___/
| | _/ / /_\ \| | / \ \/ / /_\ \| |
| | \/ | \ | \ \____/ | \ |
|______ /\____|__ /____| \______ /\____|__ /____|
\/ \/ \/ \/
""")
print("\033[91m" + r"""
Bot has started successfully!
""")
print("\033[97m" + f'Logged in as {bot.user.name}')
print(f'Connected to {len(bot.guilds)} guild(s).')
async def main():
async with bot:
await setup_extensions()
await bot.start(TOKEN)
try:
asyncio.run(main())
except KeyboardInterrupt:
print("\r\nBot is shutting down...")