// TwitchMessage.h #ifndef TWITCHMESSAGE_H #define TWITCHMESSAGE_H #include #include #include struct TwitchMessage { // Tags (после @) struct Badge { QString name; int version; }; QList badges; QString badgeInfo; QString clientNonce; QString color; QString displayName; QString emotes; bool firstMsg; QString flags; QString messageId; bool isMod; bool isVIP; bool returningChatter; qint64 roomId; bool isSubscriber; qint64 tmiSentTimestamp; bool isTurbo; qint64 userId; QString userType; // IRC parts QString ircPrefix; QString ircCommand; QString channel; QString message; // Timestamp as QDateTime QDateTime timestamp() const { return QDateTime::fromMSecsSinceEpoch(tmiSentTimestamp); } // Constructor TwitchMessage() : firstMsg(false) , isMod(false) , isVIP(false) , returningChatter(false) , roomId(0) , isSubscriber(false) , tmiSentTimestamp(0) , isTurbo(false) , userId(0) {} // Parse from raw IRC message static TwitchMessage parse(const QString &rawMessage); }; #endif // TWITCHMESSAGE_H