telegrambotlib-qt icon indicating copy to clipboard operation
telegrambotlib-qt copied to clipboard

Fixing TelegramBotChat::id

Open Malibushko opened this issue 7 years ago • 0 comments

As long as TelegramBotChat id's type is qint32 it cant fit all the information that is being returned by Telegram Bot Api methods which type is equal to long long (C++ style). So it bugs and this kind of bug is very hard to detect. To fix it you just need to replace qint32 so it becomes long long (or qint64).

...
struct TelegramBotChat : public TelegramBotObject {
    long long id;
...
virtual void fromJson(QJsonObject& object) {
        JsonHelperT<long long>::jsonPathGet(object, "id", this->id);
..
}
}

Malibushko avatar Mar 05 '19 21:03 Malibushko