Add !help command
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user