From 0680ad1c864530caf88d39ab0a4c0d8b95d8ce05 Mon Sep 17 00:00:00 2001 From: GEOEGII555 <57674559+GEOEGII555@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:17:14 +0300 Subject: [PATCH] Update prefix_bot.py --- src/mrcs/prefix_bot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mrcs/prefix_bot.py b/src/mrcs/prefix_bot.py index 2bd9024..2d65656 100644 --- a/src/mrcs/prefix_bot.py +++ b/src/mrcs/prefix_bot.py @@ -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: