qTbot 0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
telegramsendlocation.cpp
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
9
10#include <QJsonDocument>
11namespace qTbot {
12
14 float latitude,
15 float longitude,
16 const ExtraJsonObjects &extraObjects):
17 TelegramSingleRquest("sendLocation", args.toMap(true)) {
18
19 addArg("latitude", latitude);
20 addArg("longitude", longitude);
22
23
24 for (auto it = extraObjects.begin(); it != extraObjects.end(); it = std::next(it)) {
25 addArg(it.key(), QJsonDocument(*it.value()).toJson(QJsonDocument::Compact));
26 }
27}
28
29}
TelegramSendLocation(const TelegramArgs &args, float latitude, float longitude, const ExtraJsonObjects &extraObjects={})
TelegramSendLocation prepares the send location request.
TelegramSingleRquest(const QString &request, const QMap< QString, QVariant > &args)
TelegramSingleRquest This is the main constructor of the single requests.
const QMap< QString, QVariant > & args() const
args This method returns the the current list of arguments
Definition irequest.cpp:30
void addArg(const QString &key, const QVariant &val)
addArg This method pushes a new argument to the arguments list
Definition irequest.cpp:34
void setPriority(RequestPriority newPriority)
setPriority This method sets a new priority for the request.
Definition irequest.cpp:98
QHash< QString, QSharedPointer< QJsonObject > > ExtraJsonObjects
ExtraJsonObjects hash map of the extra objects of the message.
Definition irequest.h:26
The TelegramArgs class is the base structure for all telegram message arguments.
iRequest::RequestPriority requestPriority
requestPriority This is the priority of the request.