qTbot 0.89.ee6949a
qTbot is base back end library for your c++ Qt projects.
|
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< TelegramMsg > | message () const |
message returns the array of the updates messages. | |
QSharedPointer< TelegramMsg > | editedMessage () 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< TelegramInlineKeyBoardCallBack > | callbackQueryUpdate () 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" |
The TelegramUpdate class contains base information about updates from telegram.
Definition at line 21 of file telegramupdate.h.
using qTbot::TelegramUpdate::Type = QString |
Type just string value of the telegram messages types.
Definition at line 29 of file telegramupdate.h.
qTbot::TelegramUpdate::TelegramUpdate | ( | ) |
Definition at line 13 of file telegramupdate.cpp.
QSharedPointer< TelegramInlineKeyBoardCallBack > qTbot::TelegramUpdate::callbackQueryUpdate | ( | ) | const |
callbackQueryUpdate returns the callback query update.
Definition at line 53 of file telegramupdate.cpp.
QJsonObject qTbot::TelegramUpdate::channelPost | ( | ) | const |
channelPost returns the channel post update.
Definition at line 37 of file telegramupdate.cpp.
|
overridevirtual |
from This virtual function should return name of the chat when sent this message to bot.
Implements qTbot::iUpdate.
Definition at line 101 of file telegramupdate.cpp.
QJsonObject qTbot::TelegramUpdate::chatJoinRequestUpdate | ( | ) | const |
chatJoinRequestUpdate returns the chat join request update.
Definition at line 85 of file telegramupdate.cpp.
QJsonObject qTbot::TelegramUpdate::chatMemberUpdate | ( | ) | const |
chatMemberUpdate returns the chat member update.
Definition at line 81 of file telegramupdate.cpp.
QJsonObject qTbot::TelegramUpdate::chosenInlineResult | ( | ) | const |
chosenInlineResult returns the chosen inline result update.
Definition at line 49 of file telegramupdate.cpp.
bool qTbot::TelegramUpdate::contains | ( | const Type & | type | ) | const |
contains This method returns true if the message contains choosed data type.
type | This is name of the type |
Definition at line 16 of file telegramupdate.cpp.
QJsonObject qTbot::TelegramUpdate::editedChannelPost | ( | ) | const |
editedChannelPost returns the edited channel post update.
Definition at line 41 of file telegramupdate.cpp.
QSharedPointer< TelegramMsg > qTbot::TelegramUpdate::editedMessage | ( | ) | const |
editedMessage returns the edited message update.
Definition at line 28 of file telegramupdate.cpp.
|
overridevirtual |
from This virtual function should return name of the user that sent this message to bot.
Implements qTbot::iUpdate.
Definition at line 97 of file telegramupdate.cpp.
QJsonObject qTbot::TelegramUpdate::inlineQueryUpdate | ( | ) | const |
inlineQueryUpdate returns the inline query update.
Definition at line 45 of file telegramupdate.cpp.
|
overridevirtual |
isValid return true if the message is valid else false.
Reimplemented from qTbot::IJsonBasedUpdate.
Definition at line 93 of file telegramupdate.cpp.
QSharedPointer< TelegramMsg > qTbot::TelegramUpdate::message | ( | ) | const |
message returns the array of the updates messages.
Definition at line 20 of file telegramupdate.cpp.
QJsonObject qTbot::TelegramUpdate::myChatMemberUpdate | ( | ) | const |
myChatMemberUpdate returns the my chat member update.
Definition at line 77 of file telegramupdate.cpp.
QJsonObject qTbot::TelegramUpdate::pollAnswerUpdate | ( | ) | const |
pollAnswerUpdate returns the poll answer update.
Definition at line 73 of file telegramupdate.cpp.
QJsonObject qTbot::TelegramUpdate::pollUpdate | ( | ) | const |
pollUpdate returns the poll update.
Definition at line 69 of file telegramupdate.cpp.
QJsonObject qTbot::TelegramUpdate::preCheckuptAueryUpdate | ( | ) | const |
preCheckuptAueryUpdate returns the pre-checkout query update.
Definition at line 65 of file telegramupdate.cpp.
QJsonObject qTbot::TelegramUpdate::shippingQueryUpdate | ( | ) | const |
shippingQueryUpdate returns the shipping query update.
Definition at line 61 of file telegramupdate.cpp.
|
overridevirtual |
updateId returns the update ID.
Implements qTbot::iUpdate.
Definition at line 89 of file telegramupdate.cpp.
const Type qTbot::TelegramUpdate::CallbackQueryUpdate = "callback_query" |
Definition at line 37 of file telegramupdate.h.
const Type qTbot::TelegramUpdate::ChannelPostUpdate = "channel_post" |
Definition at line 33 of file telegramupdate.h.
const Type qTbot::TelegramUpdate::ChatJoinRequestUpdate = "chat_join_request" |
Definition at line 44 of file telegramupdate.h.
const Type qTbot::TelegramUpdate::ChatMemberUpdate = "chat_member" |
Definition at line 43 of file telegramupdate.h.
const Type qTbot::TelegramUpdate::ChosenInlineResultUpdate = "chosen_inline_result" |
Definition at line 36 of file telegramupdate.h.
const Type qTbot::TelegramUpdate::EditedChannelPostUpdate = "edited_channel_post" |
Definition at line 34 of file telegramupdate.h.
const Type qTbot::TelegramUpdate::EditedMessageUpdate = "edited_message" |
Definition at line 32 of file telegramupdate.h.
const Type qTbot::TelegramUpdate::InlineQueryUpdate = "inline_query" |
Definition at line 35 of file telegramupdate.h.
const Type qTbot::TelegramUpdate::MessageUpdate = "message" |
Definition at line 31 of file telegramupdate.h.
const Type qTbot::TelegramUpdate::MyChatMemberUpdate = "my_chat_member" |
Definition at line 42 of file telegramupdate.h.
const Type qTbot::TelegramUpdate::PollAnswerUpdate = "poll_answer" |
Definition at line 41 of file telegramupdate.h.
const Type qTbot::TelegramUpdate::PollUpdate = "poll" |
Definition at line 40 of file telegramupdate.h.
const Type qTbot::TelegramUpdate::PreCheckuptAueryUpdate = "pre_checkout_query" |
Definition at line 39 of file telegramupdate.h.
const Type qTbot::TelegramUpdate::ShippingQueryUpdate = "shipping_query" |
Definition at line 38 of file telegramupdate.h.