Coder Social home page Coder Social logo

modersi / telegrambotapi Goto Github PK

View Code? Open in Web Editor NEW
28.0 8.0 18.0 7.01 MB

Telegram Bot API on C++ and Qt

License: MIT License

CMake 1.23% C++ 98.56% C 0.21%
telegram telegram-bot bot telegram-api telegram-bot-api telegram-api-cxx telegram-bot-api-cxx telegram-bot-cxx telegram-cxx

telegrambotapi's Issues

Build Issue '_is_iterator_v' is not a member of 'std'

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.

QVector< InputMediaPhoto> cannot be used

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.

Telegram::Bot::sendMediaGroup is broken

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();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.