-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.py
More file actions
28 lines (23 loc) · 865 Bytes
/
bot.py
File metadata and controls
28 lines (23 loc) · 865 Bytes
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
import nextcord, os
from nextcord.ext import commands
from config import Config
# Intents
intents = nextcord.Intents.default()
intents.message_content = True
intents.guilds = True
intents.members = True
# Insantiate the bot with command prefix and defined intents
bot = commands.Bot(command_prefix=Config.COMMAND_PREFIX, intents=intents)
@bot.event
async def on_ready():
print(f'BluScreen is online as {bot.user}')
print('Connected to guilds:')
for guild in bot.guilds:
print(f'- {guild.name} (ID: {guild.id})')
# cogs stands for command groups. It's basically where the actual useful commands are
# create a new cog for each group of related things (hence command group)
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
bot.load_extension(f'cogs.{filename[:-3]}')
# Actually run the bots
bot.run(Config.TOKEN)