qTbot 0.87.9547b0c
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
22 for (auto it = extraObjects.begin(); it != extraObjects.end(); it = std::next(it)) {
23 addArg(it.key(), QJsonDocument(*it.value()).toJson(QJsonDocument::Compact));
24 }
25}
26
27}
TelegramSendLocation(const TelegramArgs &args, float latitude, float longitude, const ExtraJsonObjects &extraObjects={})
The TelegramSingleRquest class Is base class for all single requests commands with arguments.
void addArg(const QString &key, const QVariant &val)
addArg This method push new arg, to arguments list
Definition irequest.cpp:34
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.