qTbot 0.89.ee6949a
qTbot is base back end library for your c++ Qt projects.
telegramupdate.h
Go to the documentation of this file.
1//#
2//# Copyright (C) 2023-2024 QuasarApp.
3//# Distributed under the GPLv3 software license, see the accompanying
4//# Everyone is permitted to copy and distribute verbatim copies
5//# of this license document, but changing it is not allowed.
6//#
7
8#ifndef TELEGRAMUPDATE_H
9#define TELEGRAMUPDATE_H
10
11
14#include "telegrammsg.h"
15
16namespace qTbot {
17
22{
23public:
25
29 using Type = QString;
30
31 const Type MessageUpdate = "message";
32 const Type EditedMessageUpdate = "edited_message";
33 const Type ChannelPostUpdate = "channel_post";
34 const Type EditedChannelPostUpdate = "edited_channel_post";
35 const Type InlineQueryUpdate = "inline_query";
36 const Type ChosenInlineResultUpdate = "chosen_inline_result";
37 const Type CallbackQueryUpdate = "callback_query";
38 const Type ShippingQueryUpdate = "shipping_query";
39 const Type PreCheckuptAueryUpdate = "pre_checkout_query";
40 const Type PollUpdate = "poll";
41 const Type PollAnswerUpdate = "poll_answer";
42 const Type MyChatMemberUpdate = "my_chat_member";
43 const Type ChatMemberUpdate = "chat_member";
44 const Type ChatJoinRequestUpdate = "chat_join_request";
45
51 bool contains(const Type& type) const;
52
57 QSharedPointer<TelegramMsg> message() const;
58
63 QSharedPointer<TelegramMsg> editedMessage() const;
64
69 QJsonObject channelPost() const;
70
75 QJsonObject editedChannelPost() const;
76
81 QJsonObject inlineQueryUpdate() const;
82
87 QJsonObject chosenInlineResult() const;
88
93 QSharedPointer<TelegramInlineKeyBoardCallBack> callbackQueryUpdate() const;
94
99 QJsonObject shippingQueryUpdate() const;
100
105 QJsonObject preCheckuptAueryUpdate() const;
106
111 QJsonObject pollUpdate() const;
112
117 QJsonObject pollAnswerUpdate() const;
118
123 QJsonObject myChatMemberUpdate() const;
124
129 QJsonObject chatMemberUpdate() const;
130
135 QJsonObject chatJoinRequestUpdate() const;
136
141 unsigned long long updateId() const override;
142 // iMessage interface
143public:
144 bool isValid() const override;
145 QString from() const override;
146 QVariant chatId() const override;
147};
148}
149#endif // TELEGRAMUPDATE_H
The IJsonBasedUpdate class This is updates that have a json sructure.
The TelegramUpdate class contains base information about updates from telegram.
QString Type
Type just string value of the telegram messages types.
#define QTBOT_EXPORT
Definition global.h:18