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
questionMessagePollMediaPropertiesThe question of the poll.
answersIEnumerable<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 IEnumerable<MessagePollAnswerProperties>)
Each of the answers available in the poll, up to 10.
public MessagePollProperties AddAnswers(params IEnumerable<MessagePollAnswerProperties> answers)
  Parameters
answersIEnumerable<MessagePollAnswerProperties>
Returns
WithAllowMultiselect(bool)
Whether a user can select multiple answers. Defaults to false.
public MessagePollProperties WithAllowMultiselect(bool allowMultiselect = true)
  Parameters
allowMultiselectbool
Returns
WithAnswers(IEnumerable<MessagePollAnswerProperties>)
Each of the answers available in the poll, up to 10.
public MessagePollProperties WithAnswers(IEnumerable<MessagePollAnswerProperties> answers)
  Parameters
answersIEnumerable<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
durationInHoursint?
Returns
WithLayoutType(MessagePollLayoutType?)
The layout of the poll.
public MessagePollProperties WithLayoutType(MessagePollLayoutType? layoutType)
  Parameters
layoutTypeMessagePollLayoutType?
Returns
WithQuestion(MessagePollMediaProperties)
The question of the poll.
public MessagePollProperties WithQuestion(MessagePollMediaProperties question)
  Parameters
questionMessagePollMediaProperties