qTbot
0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
Toggle main menu visibility
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"
11
#include "
requests/telegramsinglerquest.h
"
12
13
#include <
qTbot/telegramargs.h
>
14
15
#define TELEGRAM_PHOTO "photo"
16
#define TELEGRAM_DOCUMENT "document"
17
18
namespace
qTbot
{
19
23
class
TelegramSendFile
:
public
TelegramSingleRquest
24
{
25
public
:
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
61
protected
:
66
virtual
QString
type
()
const
;
67
};
68
}
69
#endif
// TELEGRAMSENDFILE_H
qTbot::TelegramSendFile::method
RequestMethod method() const override
method Returns the method of the request. The file upload requests always use the Upload method.
Definition
telegramsendfile.cpp:60
qTbot::TelegramSendFile::TelegramSendFile
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.
Definition
telegramsendfile.cpp:14
qTbot::TelegramSendFile::type
virtual QString type() const
type Returns the file type. By default it is REQUEST_UPLOAD_FILE_KEY.
Definition
telegramsendfile.cpp:64
qTbot::TelegramSingleRquest::TelegramSingleRquest
TelegramSingleRquest(const QString &request, const QMap< QString, QVariant > &args)
TelegramSingleRquest This is the main constructor of the single requests.
Definition
telegramsinglerquest.cpp:17
qTbot::iRequest::RequestMethod
RequestMethod
RequestMethod This is the list of supported request types.
Definition
irequest.h:43
qTbot::iRequest::args
const QMap< QString, QVariant > & args() const
args This method returns the the current list of arguments
Definition
irequest.cpp:30
qTbot::iRequest::request
const QString & request() const
request Returns the current request command.
Definition
irequest.cpp:102
qTbot
Definition
telegramdeletemessage.cpp:8
qTbot::TelegramArgs
The TelegramArgs class is the base structure for all telegram message arguments.
Definition
telegramargs.h:21
telegramargs.h
telegramsinglerquest.h
src
qTbot
src
private
requests
telegramsendfile.h
Generated by
1.18.0