2
0
mirror of https://github.com/Nick80835/microbot synced 2025-08-31 06:26:04 +00:00

add advanced help functionality

This commit is contained in:
Nick80835
2020-07-21 09:44:28 -04:00
parent f7c94e0d1a
commit 0af9b707a5
12 changed files with 64 additions and 37 deletions

View File

@@ -63,14 +63,14 @@ class Loader():
def decorator(func):
if args.get("hide_help", False):
if func.__module__.split(".")[-1] in self.help_hidden_dict:
self.help_hidden_dict[func.__module__.split(".")[-1]] += [pattern]
self.help_hidden_dict[func.__module__.split(".")[-1]] += [[pattern, args.get('help', None)]]
else:
self.help_hidden_dict[func.__module__.split(".")[-1]] = [pattern]
self.help_hidden_dict[func.__module__.split(".")[-1]] = [[pattern, args.get('help', None)]]
else:
if func.__module__.split(".")[-1] in self.help_dict:
self.help_dict[func.__module__.split(".")[-1]] += [pattern]
self.help_dict[func.__module__.split(".")[-1]] += [[pattern, args.get('help', None)]]
else:
self.help_dict[func.__module__.split(".")[-1]] = [pattern]
self.help_dict[func.__module__.split(".")[-1]] = [[pattern, args.get('help', None)]]
self.command_handler.incoming_commands.append({
"pattern": pattern,
@@ -103,14 +103,14 @@ class Loader():
for pattern in pattern_list:
if args.get("hide_help", False):
if func.__module__.split(".")[-1] in self.help_hidden_dict:
self.help_hidden_dict[func.__module__.split(".")[-1]] += [pattern]
self.help_hidden_dict[func.__module__.split(".")[-1]] += [[pattern, args.get('help', None)]]
else:
self.help_hidden_dict[func.__module__.split(".")[-1]] = [pattern]
self.help_hidden_dict[func.__module__.split(".")[-1]] = [[pattern, args.get('help', None)]]
else:
if func.__module__.split(".")[-1] in self.help_dict:
self.help_dict[func.__module__.split(".")[-1]] += [pattern]
self.help_dict[func.__module__.split(".")[-1]] += [[pattern, args.get('help', None)]]
else:
self.help_dict[func.__module__.split(".")[-1]] = [pattern]
self.help_dict[func.__module__.split(".")[-1]] = [[pattern, args.get('help', None)]]
self.command_handler.incoming_commands.append({
"pattern": pattern,