qTbot 0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
telegramargs.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
8#ifndef TELEGRAMARGS_H
9#define TELEGRAMARGS_H
10
11#include <QVariant>
12#include "global.h"
13#include "irequest.h"
14
15namespace qTbot {
16
20struct QTBOT_EXPORT TelegramArgs
21{
33 TelegramArgs(const QVariant& id,
34 const QString& text = "",
35 unsigned long long replyToMessageId = 0,
36 const QString& parseMode = "html",
37 bool disableWebPagePreview = false,
38 const QString& callBackQueryId = "",
39 const std::function<void(int msgId)>& msgIdCB = {},
41 );
42
47 QString text = "";
48
53 QVariant chatId = {};
54
59 QString callBackQueryId = {};
60
65 unsigned long long replyToMessageId = 0;
66
71 QString parseMode = "html";
72
78
84 QMap<QString, QVariant> toMap(bool textAsCaption = false) const;
85
89 std::function<void(int msgId)> msgIdCB = {};
90
95};
96
97}
98#endif // TELEGRAMARGS_H
RequestPriority
The RequestPriority enum This is the list of request execution priorities on the client side.
Definition irequest.h:61
@ NormalPriority
NormalPriority the request has a normal priority. This is the default value.
Definition irequest.h:73
QString callBackQueryId
Callback query ID. Default: "".
bool disableWebPagePreview
Disable web page preview when sending links. Default: false.
QMap< QString, QVariant > toMap(bool textAsCaption=false) const
toMap This method converts all arguments to a map.
iRequest::RequestPriority requestPriority
requestPriority This is the priority of the request.
TelegramArgs(const QVariant &id, const QString &text="", unsigned long long replyToMessageId=0, const QString &parseMode="html", bool disableWebPagePreview=false, const QString &callBackQueryId="", const std::function< void(int msgId)> &msgIdCB={}, iRequest::RequestPriority priority=iRequest::RequestPriority::NormalPriority)
TelegramArgs main constructor of the message arguments.
QString parseMode
Parse mode of the message. Default: "html".
unsigned long long replyToMessageId
ID of the message to which a reply will be given. Default: 0.
std::function< void(int msgId)> msgIdCB
msgIdCB This is the message id callback function. It will be invoked when the request finishes succes...
QVariant chatId
Chat ID where the message will be sent. Default: {}.
QString text
Text of the message. Default: "".