Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bot/commands.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@
sendMessage($update['message']['chat']['id'], '<b>' . getTranslation('not_supported') . '</b>');
}
}
// IF a Message type is private and there is no leading '/'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify, we're not evaluating a command but a reply to a command?

Telegram has built in functionality for getting responses, could we not use that: https://core.telegram.org/bots/api#forcereply ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really like that idea! @Artanicus
This way we would not need a trainername_time database field at all 😁

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not really built for using forceReply efficiently so I'll do some plumbing in telegram/functions.php to generalize the $inline_keyboard to a $reply_markup array.

else if($update['message']['chat']['type'] == 'private'){
// Get Message from User sent to Bot and check what to do
evaluate_priv_message($update);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this function is not available in this project this will fail if not implemented in all bots dependent on the core. evaluate_priv_message sounds like functionality that should live in the core, but then that can discover handlers set by individual bots. It's a bit more work but should enable way better features in the future. :-)

}