summaryrefslogtreecommitdiff
path: root/include/tgbot/types/PollAnswer.h
blob: af96377862c79869a3648989ea48b0d5f4331d29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef TGBOT_POLLANSWER_H
#define TGBOT_POLLANSWER_H

#include "tgbot/types/Chat.h"
#include "tgbot/types/User.h"

#include <cstdint>
#include <string>
#include <memory>
#include <vector>

namespace TgBot {

/**
 * @brief This object represents an answer of a user in a non-anonymous poll.
 *
 * @ingroup types
 */
class PollAnswer {

public:
    typedef std::shared_ptr<PollAnswer> Ptr;

    /**
     * @brief Unique poll identifier
     */
    std::string pollId;

    /**
     * @brief Optional. The chat that changed the answer to the poll, if the voter is anonymous
     */
    Chat::Ptr voterChat;

    /**
     * @brief Optional. The user that changed the answer to the poll, if the voter isn't anonymous
     */
    User::Ptr user;

    /**
     * @brief 0-based identifiers of chosen answer options.
     * 
     * May be empty if the vote was retracted.
     */
    std::vector<std::int32_t> optionIds;
};
}

#endif //TGBOT_POLLANSWER_H