-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
38 lines (24 loc) · 876 Bytes
/
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
import discord
import os
from discord.ext import commands
import logging
from thunderbot.tools import settings
intents = discord.Intents.all()
def get_prefix(bot, msg):
if msg.guild is None:
return "!"
if msg.guild.id in settings.SER_PREF:
p = settings.SER_PREF[msg.guild.id][0]
return p
return "!"
client = commands.Bot(command_prefix=get_prefix, intents=intents)
@client.command(pass_context=True, hidden=True)
async def load(ctx, extension):
client.load_extension(f'thunderbot.commands.{extension}')
async def unload(ctx, extension):
client.unload_extension(f'thunderbot.commands.{extension}')
for filename in os.listdir('thunderbot/commands'):
if filename.endswith('.py'):
client.load_extension(f'thunderbot.commands.{filename[:-3]}')
logging.basicConfig(level=logging.INFO)
client.run(settings.TOKEN)