qTbot 0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
qTbot::TelegramUpdate Class Reference

The TelegramUpdate class contains base information about updates from telegram. More...

#include <telegramupdate.h>

Inheritance diagram for qTbot::TelegramUpdate:
Inheritance graph
Collaboration diagram for qTbot::TelegramUpdate:
Collaboration graph

Public Types

using Type = QString
 Type This is a string value of the telegram update types.

Public Member Functions

 TelegramUpdate ()
 TelegramUpdate default constructor.
bool contains (const Type &type) const
 contains This method returns true if the update contains the chosen data type.
QSharedPointer< TelegramMsg > message () const
 message Returns the message of this update.
QSharedPointer< TelegramMsg > editedMessage () const
 editedMessage Returns the edited message of this update.
QJsonObject channelPost () const
 channelPost Returns the channel post of this update.
QJsonObject editedChannelPost () const
 editedChannelPost Returns the edited channel post of this update.
QJsonObject inlineQueryUpdate () const
 inlineQueryUpdate Returns the inline query of this update.
QJsonObject chosenInlineResult () const
 chosenInlineResult Returns the chosen inline result of this update.
QSharedPointer< TelegramInlineKeyBoardCallBack > callbackQueryUpdate () const
 callbackQueryUpdate Returns the callback query of this update.
QJsonObject shippingQueryUpdate () const
 shippingQueryUpdate Returns the shipping query of this update.
QJsonObject preCheckuptAueryUpdate () const
 preCheckuptAueryUpdate Returns the pre-checkout query of this update.
QJsonObject pollUpdate () const
 pollUpdate Returns the poll of this update.
QJsonObject pollAnswerUpdate () const
 pollAnswerUpdate Returns the poll answer of this update.
QJsonObject myChatMemberUpdate () const
 myChatMemberUpdate Returns the my chat member of this update.
QJsonObject chatMemberUpdate () const
 chatMemberUpdate Returns the chat member of this update.
QJsonObject chatJoinRequestUpdate () const
 chatJoinRequestUpdate Returns the chat join request of this update.
unsigned long long updateId () const override
 updateId Returns the update ID.
bool isValid () const override
 isValid returns true if the update is valid else false.
QString from () const override
 from This virtual function should return the id of the user that sent this update to the bot.
QVariant chatId () const override
 chatId This virtual function should return the id of the chat that sent this update to the bot.
Public Member Functions inherited from qTbot::IJsonBasedUpdate
 IJsonBasedUpdate ()
 IJsonBasedUpdate default constructor.
void setRawData (const QByteArray &newRawData) override
 setRawData This method sets a new raw data value.
Public Member Functions inherited from qTbot::iUpdate
 iUpdate ()
 iUpdate default constructor.
const QByteArray & rawData () const
 rawData returns the raw data of the update. The raw data is the not parsed value from the server.
Public Member Functions inherited from qTbot::IJsonBasedObject
 IJsonBasedObject ()
 IJsonBasedObject default constructor.
 IJsonBasedObject (const QJsonObject &newRawJson)
 IJsonBasedObject constructs the object from a raw json value.
const QJsonObject & rawJson () const
 rawJson Telegram uses a rest api with json objects. So all received messages are parsed into a json object.
virtual void setRawJson (const QJsonObject &newRawJson)
 setRawJson This method sets a new raw json data of the object.

Public Attributes

const Type MessageUpdate = "message"
 MessageUpdate This is the type of a normal message update.
const Type EditedMessageUpdate = "edited_message"
 EditedMessageUpdate This is the type of an edited message update.
const Type ChannelPostUpdate = "channel_post"
 ChannelPostUpdate This is the type of a channel post update.
const Type EditedChannelPostUpdate = "edited_channel_post"
 EditedChannelPostUpdate This is the type of an edited channel post update.
const Type InlineQueryUpdate = "inline_query"
 InlineQueryUpdate This is the type of an inline query update.
const Type ChosenInlineResultUpdate = "chosen_inline_result"
 ChosenInlineResultUpdate This is the type of a chosen inline result update.
const Type CallbackQueryUpdate = "callback_query"
 CallbackQueryUpdate This is the type of a callback query update.
const Type ShippingQueryUpdate = "shipping_query"
 ShippingQueryUpdate This is the type of a shipping query update.
const Type PreCheckuptAueryUpdate = "pre_checkout_query"
 PreCheckuptAueryUpdate This is the type of a pre-checkout query update.
const Type PollUpdate = "poll"
 PollUpdate This is the type of a poll update.
const Type PollAnswerUpdate = "poll_answer"
 PollAnswerUpdate This is the type of a poll answer update.
const Type MyChatMemberUpdate = "my_chat_member"
 MyChatMemberUpdate This is the type of a my chat member update.
const Type ChatMemberUpdate = "chat_member"
 ChatMemberUpdate This is the type of a chat member update.
const Type ChatJoinRequestUpdate = "chat_join_request"
 ChatJoinRequestUpdate This is the type of a chat join request update.

Detailed Description

The TelegramUpdate class contains base information about updates from telegram.

Definition at line 21 of file telegramupdate.h.

Member Typedef Documentation

◆ Type

using qTbot::TelegramUpdate::Type = QString

Type This is a string value of the telegram update types.

Definition at line 32 of file telegramupdate.h.

Constructor & Destructor Documentation

◆ TelegramUpdate()

qTbot::TelegramUpdate::TelegramUpdate ( )

TelegramUpdate default constructor.

Definition at line 13 of file telegramupdate.cpp.

Member Function Documentation

◆ callbackQueryUpdate()

QSharedPointer< TelegramInlineKeyBoardCallBack > qTbot::TelegramUpdate::callbackQueryUpdate ( ) const

callbackQueryUpdate Returns the callback query of this update.

Returns
The callback query of the update.

Definition at line 53 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ channelPost()

QJsonObject qTbot::TelegramUpdate::channelPost ( ) const

channelPost Returns the channel post of this update.

Returns
The channel post of the update.

Definition at line 37 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ chatId()

QVariant qTbot::TelegramUpdate::chatId ( ) const
overridevirtual

chatId This virtual function should return the id of the chat that sent this update to the bot.

Returns
id of the chat.

Implements qTbot::iUpdate.

Definition at line 101 of file telegramupdate.cpp.

◆ chatJoinRequestUpdate()

QJsonObject qTbot::TelegramUpdate::chatJoinRequestUpdate ( ) const

chatJoinRequestUpdate Returns the chat join request of this update.

Returns
The chat join request of the update.

Definition at line 85 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ chatMemberUpdate()

QJsonObject qTbot::TelegramUpdate::chatMemberUpdate ( ) const

chatMemberUpdate Returns the chat member of this update.

Returns
The chat member of the update.

Definition at line 81 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ chosenInlineResult()

QJsonObject qTbot::TelegramUpdate::chosenInlineResult ( ) const

chosenInlineResult Returns the chosen inline result of this update.

Returns
The chosen inline result of the update.

Definition at line 49 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ contains()

bool qTbot::TelegramUpdate::contains ( const Type & type) const

contains This method returns true if the update contains the chosen data type.

Parameters
typeThis is the name of the type
Returns
true if the chosen type is available in this update.

Definition at line 16 of file telegramupdate.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ editedChannelPost()

QJsonObject qTbot::TelegramUpdate::editedChannelPost ( ) const

editedChannelPost Returns the edited channel post of this update.

Returns
The edited channel post of the update.

Definition at line 41 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ editedMessage()

QSharedPointer< TelegramMsg > qTbot::TelegramUpdate::editedMessage ( ) const

editedMessage Returns the edited message of this update.

Returns
The edited message of the update.

Definition at line 28 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ from()

QString qTbot::TelegramUpdate::from ( ) const
overridevirtual

from This virtual function should return the id of the user that sent this update to the bot.

Returns
id of the sender.

Implements qTbot::iUpdate.

Definition at line 97 of file telegramupdate.cpp.

◆ inlineQueryUpdate()

QJsonObject qTbot::TelegramUpdate::inlineQueryUpdate ( ) const

inlineQueryUpdate Returns the inline query of this update.

Returns
The inline query of the update.

Definition at line 45 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ isValid()

bool qTbot::TelegramUpdate::isValid ( ) const
overridevirtual

isValid returns true if the update is valid else false.

Returns
true if the update is valid else false.

Reimplemented from qTbot::IJsonBasedUpdate.

Definition at line 93 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ message()

QSharedPointer< TelegramMsg > qTbot::TelegramUpdate::message ( ) const

message Returns the message of this update.

Returns
the message of the update.

Definition at line 20 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ myChatMemberUpdate()

QJsonObject qTbot::TelegramUpdate::myChatMemberUpdate ( ) const

myChatMemberUpdate Returns the my chat member of this update.

Returns
The my chat member of the update.

Definition at line 77 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ pollAnswerUpdate()

QJsonObject qTbot::TelegramUpdate::pollAnswerUpdate ( ) const

pollAnswerUpdate Returns the poll answer of this update.

Returns
The poll answer of the update.

Definition at line 73 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ pollUpdate()

QJsonObject qTbot::TelegramUpdate::pollUpdate ( ) const

pollUpdate Returns the poll of this update.

Returns
The poll of the update.

Definition at line 69 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ preCheckuptAueryUpdate()

QJsonObject qTbot::TelegramUpdate::preCheckuptAueryUpdate ( ) const

preCheckuptAueryUpdate Returns the pre-checkout query of this update.

Returns
The pre-checkout query of the update.

Definition at line 65 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ shippingQueryUpdate()

QJsonObject qTbot::TelegramUpdate::shippingQueryUpdate ( ) const

shippingQueryUpdate Returns the shipping query of this update.

Returns
The shipping query of the update.

Definition at line 61 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ updateId()

unsigned long long qTbot::TelegramUpdate::updateId ( ) const
overridevirtual

updateId Returns the update ID.

Returns
The update ID.

Implements qTbot::iUpdate.

Definition at line 89 of file telegramupdate.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ CallbackQueryUpdate

const Type qTbot::TelegramUpdate::CallbackQueryUpdate = "callback_query"

CallbackQueryUpdate This is the type of a callback query update.

Definition at line 61 of file telegramupdate.h.

◆ ChannelPostUpdate

const Type qTbot::TelegramUpdate::ChannelPostUpdate = "channel_post"

ChannelPostUpdate This is the type of a channel post update.

Definition at line 45 of file telegramupdate.h.

◆ ChatJoinRequestUpdate

const Type qTbot::TelegramUpdate::ChatJoinRequestUpdate = "chat_join_request"

ChatJoinRequestUpdate This is the type of a chat join request update.

Definition at line 89 of file telegramupdate.h.

◆ ChatMemberUpdate

const Type qTbot::TelegramUpdate::ChatMemberUpdate = "chat_member"

ChatMemberUpdate This is the type of a chat member update.

Definition at line 85 of file telegramupdate.h.

◆ ChosenInlineResultUpdate

const Type qTbot::TelegramUpdate::ChosenInlineResultUpdate = "chosen_inline_result"

ChosenInlineResultUpdate This is the type of a chosen inline result update.

Definition at line 57 of file telegramupdate.h.

◆ EditedChannelPostUpdate

const Type qTbot::TelegramUpdate::EditedChannelPostUpdate = "edited_channel_post"

EditedChannelPostUpdate This is the type of an edited channel post update.

Definition at line 49 of file telegramupdate.h.

◆ EditedMessageUpdate

const Type qTbot::TelegramUpdate::EditedMessageUpdate = "edited_message"

EditedMessageUpdate This is the type of an edited message update.

Definition at line 41 of file telegramupdate.h.

◆ InlineQueryUpdate

const Type qTbot::TelegramUpdate::InlineQueryUpdate = "inline_query"

InlineQueryUpdate This is the type of an inline query update.

Definition at line 53 of file telegramupdate.h.

◆ MessageUpdate

const Type qTbot::TelegramUpdate::MessageUpdate = "message"

MessageUpdate This is the type of a normal message update.

Definition at line 37 of file telegramupdate.h.

◆ MyChatMemberUpdate

const Type qTbot::TelegramUpdate::MyChatMemberUpdate = "my_chat_member"

MyChatMemberUpdate This is the type of a my chat member update.

Definition at line 81 of file telegramupdate.h.

◆ PollAnswerUpdate

const Type qTbot::TelegramUpdate::PollAnswerUpdate = "poll_answer"

PollAnswerUpdate This is the type of a poll answer update.

Definition at line 77 of file telegramupdate.h.

◆ PollUpdate

const Type qTbot::TelegramUpdate::PollUpdate = "poll"

PollUpdate This is the type of a poll update.

Definition at line 73 of file telegramupdate.h.

◆ PreCheckuptAueryUpdate

const Type qTbot::TelegramUpdate::PreCheckuptAueryUpdate = "pre_checkout_query"

PreCheckuptAueryUpdate This is the type of a pre-checkout query update.

Definition at line 69 of file telegramupdate.h.

◆ ShippingQueryUpdate

const Type qTbot::TelegramUpdate::ShippingQueryUpdate = "shipping_query"

ShippingQueryUpdate This is the type of a shipping query update.

Definition at line 65 of file telegramupdate.h.


The documentation for this class was generated from the following files: