modersi / telegrambotapi Goto Github PK
View Code? Open in Web Editor NEWTelegram Bot API on C++ and Qt
License: MIT License
Telegram Bot API on C++ and Qt
License: MIT License
Hi! I need so much your library, but can't build it in Qt 6.6.3. In 'QJsonArrayInserter.h', row 33, where we have
/** @brief Creates a new QJsonArray with the contents of the range [first, last) */
template<typename Iterator>
requires std::_Is_iterator_v<Iterator>
static QJsonArray make(Iterator begin, Iterator end);
compiler throws a build issue '_is_iterator_v' is not a member of 'std'. I tried to find this template '_Is_iterator_v' in cppreference.com and cplusplus.com but don't give any results! Also I tried recent gcc compiler (14.0.1) with the same result.
Can you advise how to compile the library in Qt 6.6.3 (and for Ubuntu 22.04 LTS in particular)?
Best regards, Oleksiy.
The library uses QtNetwork instead, strangely to have a dependency which is not used at all.
You cannot actually use any of Telegram::Bot::sendMediaGroup
methods, because you cannot create such vectors as QVector<InputMediaPhoto>
for example.
One can only create such vectors using initializers:
QVector< InputMediaPhoto> v = { InputMediaPhoto(new QFile()), InputMediaPhoto(new QFile()) };
But you cannot add new items to it:
v.emplace_back(InputMediaPhoto(new QFile()) );
Possible solution: const Type type = Type::PHOTO;
must be changed to Type type = Type::PHOTO;
in the header.
Error 400 (Bad Request: can't parse InputMedia: media not found)
Simple example:
auto photo_file = std::make_shared<QFile>("D:/1.png");
auto photo_file2 = std::make_shared<QFile>("D:/2.png");
bool bOk1 = photo_file->open(QIODevice::ReadOnly);
bool bOk2 = photo_file2->open(QIODevice::ReadOnly);
Q_ASSERT(bOk1 && bOk2);
_bot->sendMediaGroup(chat_id,
{ InputMediaPhoto(photo_file.get()), InputMediaPhoto(photo_file2.get()) },
{ }
).get();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.