import discord
from discord.ext import commands # Importing the commands library from discord
import os
from configparser import ConfigParser


config = ConfigParser() # Create a config parser object from library

config.read(os.path.join("config", "config.ini"))
client = commands.Bot(command_prefix=config['discord']['prefix']) # bot prefix from ini file

init_ext = [] # list of extensions to load

# Load all cogs
for filename in os.listdir('src/cogs'):
    if filename.endswith('.py'): # only load .py files
        init_ext.append('cogs.' + filename[:-3]) # remove .py from filename
        
# Load all extensions  
if __name__ == '__main__':
    for cog in init_ext:
        client.load_extension(cog)

client.run(config["discord"]["token"]) # run client
import discord
from discord.ext import commands # Importing the commands library from discord
import os
from configparser import ConfigParser


config = ConfigParser() # Create a config parser object from library

config.read(os.path.join("config", "config.ini"))
client = commands.Bot(command_prefix=config['discord']['prefix']) # bot prefix from ini file

init_ext = [] # list of extensions to load

# Load all cogs
for filename in os.listdir('src/cogs'):
    if filename.endswith('.py'): # only load .py files
        init_ext.append('cogs.' + filename[:-3]) # remove .py from filename
        
# Load all extensions  
if __name__ == '__main__':
    for cog in init_ext:
        client.load_extension(cog)

client.run(config["discord"]["token"]) # run client
# Importing the commands library from discord # Create a config parser object from library # bot prefix from ini file # list of extensions to load # Load all cogs # only load .py files # remove .py from filename # Load all extensions # run client