qTbot 0.87.9547b0c
qTbot is base back end library for your c++ Qt projects.
telegramsendfile.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#ifndef TELEGRAMSENDFILE_H
8#define TELEGRAMSENDFILE_H
9
10#include "qfileinfo.h"
12
13#include <qTbot/telegramargs.h>
14
15#define TELEGRAM_PHOTO "photo"
16#define TELEGRAM_DOCUMENT "document"
17
18namespace qTbot {
19
24{
25public:
26
27 TelegramSendFile(const QString &request,
28 const QString &fileName,
29 const QString &fileType,
30 const QByteArray& data,
31 const TelegramArgs &args,
32 const QHash<QString, QSharedPointer<QJsonObject> > &extraObjects = {});
33
34 TelegramSendFile(const QString &request,
35 const QFileInfo &file,
36 const TelegramArgs &args,
37 const QHash<QString, QSharedPointer<QJsonObject> > &extraObjects = {});
38
39 RequestMethod method() const override;
40
41protected:
46 virtual QString type() const;
47};
48}
49#endif // TELEGRAMSENDFILE_H
The TelegramSendFile class Base clas for upload files to server.
RequestMethod method() const override
method returns method of the request.
virtual QString type() const
type return type file. By Default it is REQUEST_UPLOAD_FILE_KEY
The TelegramSingleRquest class Is base class for all single requests commands with arguments.
RequestMethod
RequestMethod Tgis islist of supported requests types of the requests.
Definition irequest.h:40
const QMap< QString, QVariant > & args() const
args This method returns a current list of arguments
Definition irequest.cpp:30
const QString & request() const
request return current requests commnad.
Definition irequest.cpp:94
The TelegramArgs class is base structure for the all tellegram message arguments.