41 bool login(
const QByteArray &token)
override;
43 bool sendMessage(
const QVariant &chatId,
54 bool sendLocationRequest(
const QVariant &chatId,
const QString& text,
const QString &buttonText,
bool onetimeKeyboard);
63 bool sendSelfContactRequest(
const QVariant &chatId,
const QString& text,
const QString &buttonText,
bool onetimeKeyboard);
91 bool sendSpecificMessageWithKeyboard(
const TelegramArgs& args,
109 bool sendSpecificMessageWithKeyboard(
const TelegramArgs& args,
110 const QList<QList<QString> > &keyboard,
111 bool onTimeKeyboard =
false,
112 bool autoResizeKeyboard =
true);
114 bool deleteMessage(
const QVariant& chatId,
const QVariant& messageId)
override;
131 bool editSpecificMessageWithKeyboard(
const QVariant &messageId,
133 const QList<QList<QString> > &keyboard = {},
134 bool onTimeKeyboard =
false,
135 bool autoResizeKeyboard =
false);
152 bool editSpecificMessageWithKeyboard(
const QVariant& messageId,
172 bool editMessageKeyboard(
const QVariant& messageId,
173 const QVariant &chatId,
175 const QString &callBackQueryId =
"");
189 bool editSpecificMessage(
const QVariant &messageId,
198 QFuture<QByteArray> getFile(
const QString& fileId,
FileType fileType = FileType::Ram)
override;
205 QFuture<QByteArray> getFileMeta(
const QString& fileId);
207 bool sendFile(
const QFileInfo& file,
const QVariant& chatId)
override;
209 bool sendFile(
const QByteArray& file,
const QString& fileName,
const QVariant& chatId)
override;
217 bool sendFileMessage(
const TelegramArgs& args,
const QFileInfo& file);
226 bool sendFileMessage(
const TelegramArgs& args,
const QByteArray& file,
const QString& fileName);
237 const QFileInfo& photo,
250 const QByteArray& photo,
251 const QString& fileName,
260 bool sendFileById(
const QString& fileID,
const QVariant& chatId);
285 const QString& phone,
286 const QString& firstName,
287 const QString& secondName =
"");
334 unsigned long long id()
const;
340 const QString& username()
const;
347 int gelLastMessageId(
unsigned long long &chatId)
const;
355 void setId(
unsigned long long newId);
361 void setUsername(
const QString &newUsername);
363 QString makeUrl(
const QSharedPointer<iRequest>& request)
const override;
370 int getFileSizeByUniqueId(
const QString&
id)
const;
377 QSharedPointer<TelegramFile> getFileInfoByUniqueId(
const QString&
id)
const;
383 virtual void onRequestError(
const QSharedPointer<TelegramUpdateAnswer>& ansverWithError)
const;
385 void handleIncomeNewUpdate(
const QSharedPointer<iUpdate> &)
override;
393 virtual bool sendMessageRequest(
const QSharedPointer<iRequest> &rquest,
394 const std::function<
void(
int msgId)>& msgIdCB = {});
397 void handleLogin(
const QByteArray &ansver);
398 void handleLoginErr(QNetworkReply::NetworkError err);
399 void handleFileHeader(
const QByteArray &header);
403 QString findFileInlocatStorage(
const QString& fileId)
const;
404 QHash<QString, QSharedPointer<QJsonObject> >
408 const QList<QList<QString> > &keyboard);
410 unsigned long long _id = 0;
412 QMap<QString, std::function<void(
const QString&,
const QVariant&)>> _handleButtons;
414 QHash<unsigned long long, int> _lastMessageId;
416 QHash<QString, QSharedPointer<TelegramFile>> _filesMetaInfo;