chat property

Chat? get chat

A shorthand getter for the Chat instance from the update.

This can be any of msg.chat or myChatMember.chat or chatMember.chat or chatJoinRequest.chat or messageReaction.chat or messageReactionCount.chat or chatBoost.chat or removedChatBoost.chat or callbackQuery.message.chat, or businessMessage.chat or editedBusinessMessage.chat or deletedBusinessMessage.chat.

Implementation

Chat? get chat {
  Chat? x = (chatJoinRequest ??
          removedChatBoost ??
          chatBoost ??
          chatMember ??
          myChatMember ??
          messageReaction ??
          messageReactionCount ??
          deletedBusinessMessages ??
          msg)
      ?.chat;

  if (callbackQuery?.message is Message) {
    x ??= (callbackQuery?.message as Message).chat;
  }

  return x;
}