qTbot 0.2.123.6f57966
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-2026 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
36 TelegramSendFile(const QString &request,
37 const QString &fileName,
38 const QString &fileType,
39 const QByteArray& data,
40 const TelegramArgs &args,
41 const QHash<QString, QSharedPointer<QJsonObject> > &extraObjects = {});
42
50 TelegramSendFile(const QString &request,
51 const QFileInfo &file,
52 const TelegramArgs &args,
53 const QHash<QString, QSharedPointer<QJsonObject> > &extraObjects = {});
54
59 RequestMethod method() const override;
60
61protected:
66 virtual QString type() const;
67};
68}
69#endif // TELEGRAMSENDFILE_H
RequestMethod method() const override
method Returns the method of the request. The file upload requests always use the Upload method.
TelegramSendFile(const QString &request, const QString &fileName, const QString &fileType, const QByteArray &data, const TelegramArgs &args, const QHash< QString, QSharedPointer< QJsonObject > > &extraObjects={})
TelegramSendFile prepares the send file request from a byte array.
virtual QString type() const
type Returns the file type. By default it is REQUEST_UPLOAD_FILE_KEY.
TelegramSingleRquest(const QString &request, const QMap< QString, QVariant > &args)
TelegramSingleRquest This is the main constructor of the single requests.
RequestMethod
RequestMethod This is the list of supported request types.
Definition irequest.h:43
const QMap< QString, QVariant > & args() const
args This method returns the the current list of arguments
Definition irequest.cpp:30
const QString & request() const
request Returns the current request command.
Definition irequest.cpp:102
The TelegramArgs class is the base structure for all telegram message arguments.