Advertisement
Hitmare

Pull Callback Data within Command

Jun 6th, 2021
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. if ($this->getCallbackQuery() !== null) {
  2. $message = $this->getCallbackQuery()->getMessage();
  3. $chat =$this->getCallbackQuery()->getMessage()->getChat();
  4. $user = $chat;
  5. $chat_id = $this->getCallbackQuery()->getMessage()->getChat()->getId();
  6. $user_id = $chat_id;
  7. }
  8. else {
  9. $message = $this->getMessage();
  10. $message_id = $message->getMessageId();
  11. $chat_id = $message->getChat()->getId();
  12. $text = trim($message->getText(true));
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement