Add !help command

This commit is contained in:
2021-04-19 04:18:40 +00:00
parent bdfec0f9a4
commit 87bb638270
3 changed files with 35 additions and 14 deletions
+20 -3
View File
@@ -25,6 +25,7 @@ from protocol.packets import (
)
from protocol.types import Slot
import print_help
import utils
importlib.reload(utils)
@@ -492,7 +493,23 @@ class Game:
try:
## ### Public Commands
## These can be ran by anyone, all bots will reply
## These can be ran by anyone, all bots will reply.
## !help - prints this whole help message to console
## !help [command] - replies in-game explaining command
if command == 'help':
if data:
for line in print_help.HELP_LINES:
if line[1:].startswith(data) or line[1:].startswith(data[1:]):
reply = 'command ' + line
break
else: # for
reply = 'command not found'
else:
for line in print_help.HELP_LINES:
print(line)
reply = 'check console'
## !ping - replies with "pong"
if command == 'ping':
@@ -653,7 +670,7 @@ class Game:
################# Specific commands ##########################
## ### Bot-specific Commands
## These will only run for the bot they are addressed to
## These will only run for the bot they are addressed to.
if for_me:
pass
@@ -897,7 +914,7 @@ class Game:
################# Authorized commands ##########################
## ### Authorized Commands
## These dangerous commands can only be ran by the bot owner
## These dangerous commands can only be ran by the bot owner.
if authed: