qTbot 0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
telegramaudio.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#include "telegramaudio.h"
8
9namespace qTbot {
10
15
16TelegramAudio::TelegramAudio(const QJsonObject &jsonObject) : TelegramFile(jsonObject) {}
17
19 return rawJson()["duration"].toInt();
20}
21
22QString TelegramAudio::fileName() const {
23 return rawJson()["file_name"].toString();
24}
25
26QString TelegramAudio::mimeType() const {
27 return rawJson()["mime_type"].toString();
28}
29}
30
const QJsonObject & rawJson() const
rawJson Telegram uses a rest api with json objects. So all received messages are parsed into a json o...
QString fileName() const
Returns the file name of the audio.
int duration() const
Returns the duration of the audio in seconds.
QString mimeType() const
Returns the MIME type of the audio.
TelegramAudio()
TelegramAudio default constructor.
TelegramFile()
TelegramFile default constructor.