-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
43 lines (34 loc) · 1.26 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
import os
import discord
from dotenv import load_dotenv
load_dotenv()
bot = discord.Bot(intents=discord.Intents.all(), description="Jaxie is a mod-utility bot!", owner_id=718712985371148309)
@bot.slash_command()
async def load(ctx, name):
# if ctx.author.id != 718712985371148309:
# return
bot.load_extension(f'cogs.{name}')
await ctx.respond(f'Loaded {name}')
@bot.slash_command()
async def unloaded(ctx, name):
# if ctx.author.id != 718712985371148309:
# return
bot.unload_extension(f'cogs.{name}')
await ctx.respond(f'Unloaded {name}')
@bot.slash_command()
async def reload(ctx, name):
# if ctx.author.id != 718712985371148309:
# return
bot.unload_extension(f'cogs.{name}')
bot.load_extension(f'cogs.{name}')
await ctx.respond(f'Reloaded {name}')
for foldername in os.listdir('./cogs'):
for filename in os.listdir(f'cogs/{foldername}'):
if filename.endswith('.py'):
bot.load_extension(f'cogs.{foldername}.{filename[:-3]}')
@bot.event
async def on_ready():
print(f"We have logged in as {bot.user}")
print(f"Discord Version: {discord.__version__}")
await bot.change_presence(activity = discord.Activity(type = discord.ActivityType.watching, name = f"/help | Watching over {len(bot.guilds)} servers!"))
bot.run(os.getenv('TOKEN'))