Skip to content

Commit

Permalink
Edited load_command_dir in AoiClient
Browse files Browse the repository at this point in the history
  • Loading branch information
LilbabxJJ-1 committed Jun 2, 2023
1 parent 7a5a11e commit 7906aa3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
11 changes: 7 additions & 4 deletions Aoipy/Classes/AoiPyClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Aoipy(discord.Client):
# Global variables
global bots

def __init__(self, prefix: str, case_insensitive: bool = False, intents: tuple = ("default",), activity=None, help_command=None, load_command_dir: str="commands"):
def __init__(self, prefix, case_insensitive, intents: tuple, activity, help_command, load_command_dir):
# Global variables
global bots

Expand Down Expand Up @@ -51,15 +51,18 @@ def __init__(self, prefix: str, case_insensitive: bool = False, intents: tuple =
activity=self._activity,
help_command=self._help_command)
bots = self._clients
load_commands(load_command_dir)
try:
load_commands(load_command_dir)
except FileNotFoundError:
pass
super().__init__(intents=self.intent)

@property
def clients(self):
return self._clients


def AoipyClient(prefix: str, case_insensitive: bool = False, intents: tuple = ("default",), activity=None, help_command=None):
def AoipyClient(prefix: str, case_insensitive: bool = False, intents: tuple = ("default",), activity=None, help_command=None, load_command_dir = "commands"):
# Global variables
global bots
global TotalFuncs
Expand All @@ -70,6 +73,6 @@ def AoipyClient(prefix: str, case_insensitive: bool = False, intents: tuple = ("
Functions.register_functions()

# Create Start instance and return working bot
_final = Aoipy(prefix, case_insensitive, intents, activity, help_command)
_final = Aoipy(prefix, case_insensitive, intents, activity, help_command, load_command_dir)
working = _final.clients
return working
7 changes: 0 additions & 7 deletions commands/test.py

This file was deleted.

0 comments on commit 7906aa3

Please sign in to comment.