qTbot 0.87.9547b0c
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>

Public Types

using Type = QString
 Type just string value of the telegram messages types.
 

Public Member Functions

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

Public Attributes

const Type MessageUpdate = "message"
 
const Type EditedMessageUpdate = "edited_message"
 
const Type ChannelPostUpdate = "channel_post"
 
const Type EditedChannelPostUpdate = "edited_channel_post"
 
const Type InlineQueryUpdate = "inline_query"
 
const Type ChosenInlineResultUpdate = "chosen_inline_result"
 
const Type CallbackQueryUpdate = "callback_query"
 
const Type ShippingQueryUpdate = "shipping_query"
 
const Type PreCheckuptAueryUpdate = "pre_checkout_query"
 
const Type PollUpdate = "poll"
 
const Type PollAnswerUpdate = "poll_answer"
 
const Type MyChatMemberUpdate = "my_chat_member"
 
const Type ChatMemberUpdate = "chat_member"
 
const Type ChatJoinRequestUpdate = "chat_join_request"
 

Detailed Description

The TelegramUpdate class contains base information about updates from telegram.

Definition at line 21 of file telegramupdate.h.

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

Member Typedef Documentation

◆ Type

using qTbot::TelegramUpdate::Type = QString

Type just string value of the telegram messages types.

Definition at line 29 of file telegramupdate.h.

Constructor & Destructor Documentation

◆ TelegramUpdate()

qTbot::TelegramUpdate::TelegramUpdate ( )

Definition at line 13 of file telegramupdate.cpp.

Member Function Documentation

◆ callbackQueryUpdate()

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

callbackQueryUpdate returns the callback query update.

Returns
QJsonObject containing the callback query 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 update.

Returns
QJsonObject containing the channel post update.

Definition at line 37 of file telegramupdate.cpp.

Here is the call graph for this function:

◆ chatId()

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

from This virtual function should return name of the chat when sent this message to bot.

Returns
id of the sender.

Implements qTbot::iUpdate.

Definition at line 101 of file telegramupdate.cpp.

◆ chatJoinRequestUpdate()

QJsonObject qTbot::TelegramUpdate::chatJoinRequestUpdate ( ) const

chatJoinRequestUpdate returns the chat join request update.

Returns
QJsonObject containing the chat join request 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 update.

Returns
QJsonObject containing the chat member 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 update.

Returns
QJsonObject containing the chosen inline result 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 message contains choosed data type.

Parameters
typeThis is name of the type
Returns
true if the choosed type is available in this message.

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 update.

Returns
QJsonObject containing the edited channel post 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 update.

Returns
QJsonObject containing the edited message 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 name of the user that sent this message to 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 update.

Returns
QJsonObject containing the inline query 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 return true if the message is valid else false.

Returns
true if the message 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 array of the updates messages.

Returns
list of updates.

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 update.

Returns
QJsonObject containing the my chat member 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 update.

Returns
QJsonObject containing the poll answer 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 update.

Returns
QJsonObject containing the poll 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 update.

Returns
QJsonObject containing the pre-checkout query 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 update.

Returns
QJsonObject containing the shipping query 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"

Definition at line 37 of file telegramupdate.h.

◆ ChannelPostUpdate

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

Definition at line 33 of file telegramupdate.h.

◆ ChatJoinRequestUpdate

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

Definition at line 44 of file telegramupdate.h.

◆ ChatMemberUpdate

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

Definition at line 43 of file telegramupdate.h.

◆ ChosenInlineResultUpdate

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

Definition at line 36 of file telegramupdate.h.

◆ EditedChannelPostUpdate

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

Definition at line 34 of file telegramupdate.h.

◆ EditedMessageUpdate

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

Definition at line 32 of file telegramupdate.h.

◆ InlineQueryUpdate

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

Definition at line 35 of file telegramupdate.h.

◆ MessageUpdate

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

Definition at line 31 of file telegramupdate.h.

◆ MyChatMemberUpdate

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

Definition at line 42 of file telegramupdate.h.

◆ PollAnswerUpdate

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

Definition at line 41 of file telegramupdate.h.

◆ PollUpdate

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

Definition at line 40 of file telegramupdate.h.

◆ PreCheckuptAueryUpdate

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

Definition at line 39 of file telegramupdate.h.

◆ ShippingQueryUpdate

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

Definition at line 38 of file telegramupdate.h.


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