qTbot 0.87.9547b0c
qTbot is base back end library for your c++ Qt projects.
telegrammsg.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 TELEGRAMMSG_H
9#define TELEGRAMMSG_H
10
11#include "imessage.h"
13#include "telegramaudio.h"
14#include "telegramdocument.h"
15#include "telegramlocation.h"
17
18namespace qTbot {
19
25{
26public:
27
34 AroundSize = 0,
37
38 BestOf = 1,
40 Best = 2,
42 Fast = 3
43 };
44
48 using Type = QString;
49
53 const Type Text = "text";
54
58 const Type Image = "photo";
59
63 const Type Document = "document";
64
68 const Type Contact = "contact";
69
73 const Type Location = "location";
74
78 const Type Audio = "audio";
79
81
82 TelegramMsg(const QJsonObject& obj);
83
88 unsigned long long messageId() const override;
89
94 unsigned long long fromId() const;
95
100 bool isBot() const;
101
106 QString firstName() const;
107
112 QString lastName() const;
113
118 QString username() const;
119
124 QString languageCode() const;
125
130 QVariant chatId() const override;
131
132 bool isValid() const override;
133
134 QString from() const override;
135
140 QString chatFirstName() const;
141
146 QString chatLastName() const;
147
152 QString chatUsername() const;
153
158 QString chatType() const;
159
164 qint64 date() const;
165
170 QString text() const;
171
177 bool contains(const Type& type);
178
183 QList<QSharedPointer<TelegramImage>> images() const;
184
201 QSharedPointer<TelegramImage> image(QualitySelector behavior = AroundSize, int size = 100000) const;
202
207 QSharedPointer<TelegramDocument> documents() const;
208
213 QSharedPointer<TelegramAudio> audio() const;
214
219 QSharedPointer<TelegramContact> contact() const;
220
221 unsigned long long updateId() const override;
222
227 QSharedPointer<TelegramLocation> location() const;
228};
229
230}
231#endif // TELEGRAMMSG_H
The TelegramMsg class This class provide general mesasges of telegram. The message object can contain...
Definition telegrammsg.h:25
QString Type
Type just string value of the telegram messages types.
Definition telegrammsg.h:48
QualitySelector
The QualitySelector enum This is behavior of image and video selection.
Definition telegrammsg.h:31
The iMessage class This is main interface for the all messages.
Definition imessage.h:18
#define QTBOT_EXPORT
Definition global.h:18