From 22b5ddfe91cc1928b6e71894653e6d8e2ad28100 Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Fri, 25 Sep 2020 08:22:14 +0000 Subject: [PATCH] General Cleanup and changed visibility of methods. --- command.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/command.py b/command.py index 1155a5d..5cc817e 100644 --- a/command.py +++ b/command.py @@ -19,7 +19,7 @@ class Command: return words @staticmethod - def getCommand(string): + def __getCommand(string): words = Command.__getWords(string); if len(words) == 0: return if words[0].startswith(Command.command_prefix): @@ -27,20 +27,21 @@ class Command: return "" @staticmethod - def getArgs(string): + def __getArgs(string): words = Command.__getWords(string); return words[1:] + # Add a command @staticmethod def registerCallback(command, callback): Command.__callbacks[command] = callback @staticmethod async def call(channel, command): - func = Command.__callbacks.get(Command.getCommand(command), None) + func = Command.__callbacks.get(Command.__getCommand(command), None) if func is not None: try: - await func(channel, *tuple(Command.getArgs(command))) + await func(channel, *tuple(Command.__getArgs(command))) except TypeError as e: print(e) await channel.send("Incorrect usage.")