Skip to content

Commit fe64c25

Browse files
Tenzergbin-argo
authored andcommitted
Fix missing string formatting in "Command not found" output (#1259)
95bb61f attempted to switch the string formatting in `unknown_command()` to use f-strings instead of string concatenation, but failed to add the `f` prefix to the string, meaning the "Did you mean" part of the output when a nonexisting command is attempted is outputted literally as: > Did you mean "{self.bot_config.BOT_PREFIX}{alternatives}" ? This fixes that so the variables will be replaced in the string as intended.
1 parent b5561b7 commit fe64c25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

errbot/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def unknown_command(self, _, cmd, args):
484484
matches = set(matches)
485485
if matches:
486486
alternatives = ('" or "' + self.bot_config.BOT_PREFIX).join(matches)
487-
msg += '\n\nDid you mean "{self.bot_config.BOT_PREFIX}{alternatives}" ?'
487+
msg += f'\n\nDid you mean "{self.bot_config.BOT_PREFIX}{alternatives}" ?'
488488
return msg
489489

490490
def inject_commands_from(self, instance_to_inject):

0 commit comments

Comments
 (0)