Table of Contents

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 MessagePollMediaProperties

The 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

bool

Answers

Each of the answers available in the poll, up to 10.

[JsonPropertyName("answers")]
public IEnumerable<MessagePollAnswerProperties> Answers { get; set; }

Property Value

IEnumerable<MessagePollAnswerProperties>

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

MessagePollLayoutType?

Question

The question of the poll.

[JsonPropertyName("question")]
public MessagePollMediaProperties Question { get; set; }

Property Value

MessagePollMediaProperties

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

MessagePollProperties

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

MessagePollProperties

WithAllowMultiselect(bool)

Whether a user can select multiple answers. Defaults to false.

public MessagePollProperties WithAllowMultiselect(bool allowMultiselect = true)

Parameters

allowMultiselect bool

Returns

MessagePollProperties

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

MessagePollProperties

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

MessagePollProperties

WithLayoutType(MessagePollLayoutType?)

The layout of the poll.

public MessagePollProperties WithLayoutType(MessagePollLayoutType? layoutType)

Parameters

layoutType MessagePollLayoutType?

Returns

MessagePollProperties

WithQuestion(MessagePollMediaProperties)

The question of the poll.

public MessagePollProperties WithQuestion(MessagePollMediaProperties question)

Parameters

question MessagePollMediaProperties

Returns

MessagePollProperties