using Client everywhere

This commit is contained in:
Mylloon 2021-07-29 01:30:11 +02:00
parent 3b46ce613a
commit d68ed28bbf
3 changed files with 6 additions and 6 deletions

View file

@ -3,7 +3,7 @@ from os import listdir
from utils.core import load
from utils.commands import CommandesDB
class Bot(commands.Bot):
class Client(commands.Bot):
def __init__(self):
self.keys = load(["ACCESS_TOKEN", "PREFIX", "CHANNEL"])
super().__init__(token = self.keys["ACCESS_TOKEN"], prefix = self.keys["PREFIX"], initial_channels = self.keys["CHANNEL"])
@ -26,7 +26,7 @@ class Bot(commands.Bot):
return
raise error
client = Bot()
client = Client()
for file in listdir("modules"):
if file.endswith(".py") and file.startswith("-") == False:

View file

@ -2,8 +2,8 @@ from twitchio.ext import commands
from utils.core import load
from utils.commands import CommandesDB
def prepare(bot: commands.Bot):
bot.add_cog(Commandes(bot))
def prepare(client: commands.Bot):
client.add_cog(Commandes(client))
class Commandes(commands.Cog):
def __init__(self, client: commands.Bot):

View file

@ -1,8 +1,8 @@
from twitchio.ext import commands
from utils.core import load
def prepare(bot: commands.Bot):
bot.add_cog(Utils(bot))
def prepare(client: commands.Bot):
client.add_cog(Utils(client))
class Utils(commands.Cog):
def __init__(self, client: commands.Bot):