Started creating config file system
This commit is contained in:
32
bot.py
32
bot.py
@@ -1,27 +1,11 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
from discord.ext import commands
|
||||
import os
|
||||
import yaml
|
||||
from bots.discordbot import DiscordBot
|
||||
|
||||
class DiscordBot:
|
||||
def __init__(self, config):
|
||||
|
||||
prefixes = ["/"]
|
||||
|
||||
self.client = commands.Bot(command_prefix=prefixes, case_insensitive=True)
|
||||
self.client.prefixes = prefixes
|
||||
|
||||
# Load this cog first so the other cogs can use properties initialized here
|
||||
self.client.load_extension("cogs.events")
|
||||
|
||||
for file in os.listdir("./cogs"):
|
||||
if file.endswith(".py") and not (file.startswith(("events",))):
|
||||
self.client.load_extension(f"cogs.{file[:-3]}")
|
||||
|
||||
def run(self):
|
||||
self.client.run("NzYwNTI5NDY2MDI3MDE2MjUy.X3NYQg.Nz3bwxgltlayMStfT7F-OCbx9pE")
|
||||
|
||||
def get_client(self):
|
||||
return self.client
|
||||
|
||||
|
||||
bot = DiscordBot(None)
|
||||
bot.run()
|
||||
if __name__ == "__main__":
|
||||
bot = DiscordBot(sys.argv[1])
|
||||
bot.run()
|
||||
|
||||
Reference in New Issue
Block a user