Skip to content

Commit

Permalink
fix logging when command exists
Browse files Browse the repository at this point in the history
  • Loading branch information
codebam committed Feb 23, 2022
1 parent 8fae575 commit 1b46796
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,10 @@ export default class Bot {
(log({ execute: { text, args } }) &&
(async (text_args: string[]) =>
((command) =>
(log(
this.commands[command] ?? {
((this.commands[command] ||
log({
error: `command '${command}' does not exist`,
}
) &&
})) &&
this.commands[command]?.(this, update, [...text_args, ...args])) ||
this.updates.default)(this.getCommand(text_args)))(
text
Expand Down

0 comments on commit 1b46796

Please sign in to comment.