Skip to content

Commit

Permalink
Update prefix_bot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
GEOEGII555 authored Jan 29, 2024
1 parent c2418fc commit 0680ad1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/mrcs/prefix_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,18 @@ def _help_command(self, user: User, arguments: list[str]):
for K in self.commands:
help_index += K
help_index += ", "
help_index = help_index.removesuffix(", ")
help_index = help_index.removesuffix(", ")
self.send_text_message(help_index)
else:
command_name = " ".join(arguments)
if command_name not in self.commands:
self.send_text_message(f"I don't know a command named {command_name}! Are you sure your spelling is correct?")
return
documentation = inspect.getdoc(self.commands[command_name]).replace("[PREFIX]", self.prefix)
documentation = inspect.getdoc(self.commands[command_name])
if not documentation:
documentation = "*No docstring provided.*"
else:
documentation = documentation.replace("[PREFIX]", self.prefix)
self.send_text_message(f"Help on command {command_name}:\n" + documentation)

def on_text_message(self, user: User, message: str) -> None:
Expand Down

0 comments on commit 0680ad1

Please sign in to comment.