protected $description = 'Mark a bill as paid';
public function handle($arguments) {
- if (!$arguments) {
- $buttons = [array_values(map(function($bill) {
- return sprintf('%s%s', hide('[billid]' . $bill['id'] . '[billid]'), $bill['service'] . ' ($' . splitBill($bill['amount']) . ')');
- })(getMessagesFromInbox(
- getInbox(
- 'Utilities/' . getMessageSender($this->getUpdate()) . ' To Pay'
- ),
- require 'rules.php',
- FALSE
- )))];
-
- $reply_markup = getTelegram()->replyKeyboardMarkup([
- 'keyboard' => $buttons,
- 'resize_keyboard' => true,
- 'one_time_keyboard' => true,
- 'remove_keyboard' => true,
- 'selective' => true
- ]);
-
- $this->replyWithMessage(
- [
- 'text' => '[' . getMessageSenderDisplayName($this->getUpdate()) . '](tg://user?id=' . getMessageSender($this->getUpdate()) . '), which bill did you want to pay?',
- 'parse_mode' => 'markdown',
- 'reply_markup' => $reply_markup
- ]
- );
- }
+ $buttons = [array_values(map(function($bill) {
+ return sprintf('%s%s', hide('[billid]' . $bill['id'] . '[billid]'), $bill['service'] . ' ($' . splitBill($bill['amount']) . ')');
+ })(getMessagesFromInbox(
+ getInbox(
+ 'Utilities/' . getMessageSender($this->getUpdate()) . ' To Pay'
+ ),
+ require 'rules.php',
+ FALSE
+ )))];
+
+ $reply_markup = getTelegram()->replyKeyboardMarkup([
+ 'keyboard' => $buttons,
+ 'resize_keyboard' => true,
+ 'one_time_keyboard' => true,
+ 'remove_keyboard' => true,
+ 'selective' => true
+ ]);
+
+ $this->replyWithMessage(
+ [
+ 'text' => '[' . getMessageSenderDisplayName($this->getUpdate()) . '](tg://user?id=' . getMessageSender($this->getUpdate()) . '), which bill did you want to pay?',
+ 'parse_mode' => 'markdown',
+ 'reply_markup' => $reply_markup
+ ]
+ );
}
}