-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.py
More file actions
33 lines (21 loc) · 682 Bytes
/
bot.py
File metadata and controls
33 lines (21 loc) · 682 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
29
30
31
32
33
import os
import disnake
from disnake.ext import commands
import config
bot = commands.Bot(command_prefix="!", intents=disnake.Intents(messages=True, guild_messages=True, members=True, guilds=True))
@bot.command()
@commands.is_owner()
async def load(ctx, extension):
bot.load_extension(f"cogs.{extension}")
@bot.command()
@commands.is_owner()
async def reload(ctx, extension):
bot.reload_extension(f"cogs.{extension}")
@bot.command()
@commands.is_owner()
async def unload(ctx, extension):
bot.unload_extension(f"cogs.{extension}")
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
bot.load_extension(f"cogs.{filename[:-3]}")
bot.run(config.TOKEN)