Class MessagePollProperties
- Namespace
- NetCord
- Assembly
- NetCord.dll
public class MessagePollProperties
- Inheritance
-
MessagePollProperties
- Inherited Members
Constructors
MessagePollProperties(MessagePollMediaProperties, IEnumerable<MessagePollAnswerProperties>)
public MessagePollProperties(MessagePollMediaProperties question, IEnumerable<MessagePollAnswerProperties> answers)
Parameters
question
MessagePollMediaPropertiesThe question of the poll.
answers
IEnumerable<MessagePollAnswerProperties>Each of the answers available in the poll, up to 10.
Properties
AllowMultiselect
Whether a user can select multiple answers. Defaults to false.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("allow_multiselect")]
public bool AllowMultiselect { get; set; }
Property Value
Answers
Each of the answers available in the poll, up to 10.
[JsonPropertyName("answers")]
public IEnumerable<MessagePollAnswerProperties> Answers { get; set; }
Property Value
DurationInHours
Number of hours the poll should be open for, up to 32 days. Defaults to 24.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("duration")]
public int? DurationInHours { get; set; }
Property Value
- int?
LayoutType
The layout of the poll.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("layout_type")]
public MessagePollLayoutType? LayoutType { get; set; }
Property Value
Question
The question of the poll.
[JsonPropertyName("question")]
public MessagePollMediaProperties Question { get; set; }
Property Value
Methods
AddAnswers(params MessagePollAnswerProperties[])
Each of the answers available in the poll, up to 10.
public MessagePollProperties AddAnswers(params MessagePollAnswerProperties[] answers)
Parameters
answers
MessagePollAnswerProperties[]
Returns
AddAnswers(IEnumerable<MessagePollAnswerProperties>)
Each of the answers available in the poll, up to 10.
public MessagePollProperties AddAnswers(IEnumerable<MessagePollAnswerProperties> answers)
Parameters
answers
IEnumerable<MessagePollAnswerProperties>
Returns
WithAllowMultiselect(bool)
Whether a user can select multiple answers. Defaults to false.
public MessagePollProperties WithAllowMultiselect(bool allowMultiselect = true)
Parameters
allowMultiselect
bool
Returns
WithAnswers(IEnumerable<MessagePollAnswerProperties>)
Each of the answers available in the poll, up to 10.
public MessagePollProperties WithAnswers(IEnumerable<MessagePollAnswerProperties> answers)
Parameters
answers
IEnumerable<MessagePollAnswerProperties>
Returns
WithDurationInHours(int?)
Number of hours the poll should be open for, up to 32 days. Defaults to 24.
public MessagePollProperties WithDurationInHours(int? durationInHours)
Parameters
durationInHours
int?
Returns
WithLayoutType(MessagePollLayoutType?)
The layout of the poll.
public MessagePollProperties WithLayoutType(MessagePollLayoutType? layoutType)
Parameters
layoutType
MessagePollLayoutType?
Returns
WithQuestion(MessagePollMediaProperties)
The question of the poll.
public MessagePollProperties WithQuestion(MessagePollMediaProperties question)
Parameters
question
MessagePollMediaProperties