-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbot.py
More file actions
22 lines (18 loc) · 715 Bytes
/
bot.py
File metadata and controls
22 lines (18 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import discord
from discord.ext import commands
from console import Console
import os
import json
with open("config.json", "r") as f:
config = json.load(f)
console = Console(True)
client = commands.Bot(command_prefix=config["prefixes"], case_insensitive=True, intents=discord.Intents.all())
for module in os.listdir("Modules"):
for filename in os.listdir(f"Modules/{module}"):
if filename.endswith(".py"):
console.log(f"Loading {module}/{filename}")
client.load_extension(f"Modules.{module}.{filename[:-3]}")
try:
client.run(config["token"])
except discord.errors.ClientException as e:
console.error(f"Invalid Token - Please check the config.json file. {str(e)}")