qTbot 0.2.107.d8fc923
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-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
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);
21 setPriority(args.requestPriority);
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={})
The TelegramSingleRquest class Is base class for all single requests commands with arguments.
const QMap< QString, QVariant > & args() const
args This method returns a current list of arguments
Definition irequest.cpp:30
void addArg(const QString &key, const QVariant &val)
addArg This method push new arg, to arguments list
Definition irequest.cpp:34
void setPriority(RequestPriority newPriority)
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 base structure for the all tellegram message arguments.