Class SendPoll
java.lang.Object
io.github.natanimn.telebof.requests.AbstractBaseRequest<SendPoll,Message>
io.github.natanimn.telebof.requests.send.SendPoll
SendPoll class. Returns sent
Message on success.- Since:
- 3 March 2025
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSendPoll(Object chatId, String question, InputPollOption[] options, Api api) Required -
Method Summary
Modifier and TypeMethodDescriptionallowPaidBroadcast(boolean allowPaidBroadcast) OptionalallowsMultipleAnswers(boolean allowsMultipleAnswers) OptionalbusinessConnectionId(String businessConnectionId) OptionalcloseDate(int closeDate) OptionalcorrectOptionId(int correctOptionId) OptionaldisableNotification(boolean disableNotification) Optionalexplanation(String explanation) OptionalexplanationEntities(MessageEntity[] explanationEntities) OptionalexplanationParseMode(ParseMode explanationParseMode) OptionalisAnonymous(boolean isAnonymous) OptionalisClosed(boolean isClosed) OptionalmessageEffectId(String messageEffectId) OptionalopenPeriod(int openPeriod) OptionalprotectContent(boolean protectContent) OptionalquestionEntities(MessageEntity[] questionEntities) OptionalquestionParseMode(ParseMode questionParseMode) OptionalreplyMarkup(Markup replyMarkup) OptionalreplyParameters(ReplyParameters replyParameters) OptionalOptionalMethods inherited from class io.github.natanimn.telebof.requests.AbstractBaseRequest
exec
-
Constructor Details
-
SendPoll
Required- Parameters:
chatId- chat idquestion- questionoptions- optionsapi- api
-
-
Method Details
-
isAnonymous
Optional- Parameters:
isAnonymous- True, if the poll needs to be anonymous, defaults to True- Returns:
SendPoll
-
type
Optional- Parameters:
type- Poll type,PollType.QUIZorPollType.REGULAR, defaults toPollType.REGULAR- Returns:
SendPoll
-
allowsMultipleAnswers
Optional- Parameters:
allowsMultipleAnswers- True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False- Returns:
SendPoll
-
correctOptionId
Optional- Parameters:
correctOptionId- 0-based identifier of the correct answer option, required for polls in quiz mode- Returns:
SendPoll
-
explanation
Optional- Parameters:
explanation- Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing- Returns:
SendPoll
-
explanationParseMode
Optional- Parameters:
explanationParseMode- Mode for parsing entities in the explanation.- Returns:
SendPoll
-
explanationEntities
Optional- Parameters:
explanationEntities- A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode- Returns:
SendPoll
-
openPeriod
Optional- Parameters:
openPeriod- Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.- Returns:
SendPoll
-
closeDate
Optional- Parameters:
closeDate- Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period.- Returns:
SendPoll
-
isClosed
Optional- Parameters:
isClosed- Pass True if the poll needs to be immediately closed. This can be useful for poll preview.- Returns:
SendPoll
-
disableNotification
Optional- Parameters:
disableNotification- Sends the message silently. Users will receive a notification with no sound.- Returns:
SendPoll
-
protectContent
Optional- Parameters:
protectContent- Protects the contents of the sent message from forwarding and saving- Returns:
SendPoll
-
allowPaidBroadcast
Optional- Parameters:
allowPaidBroadcast- Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance- Returns:
SendPoll
-
replyParameters
Optional- Parameters:
replyParameters- Description of the message to reply to- Returns:
SendPoll
-
replyMarkup
Optional- Parameters:
replyMarkup- Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user- Returns:
SendPoll
-
businessConnectionId
Optional- Parameters:
businessConnectionId- Unique identifier of the business connection on behalf of which the message will be sent- Returns:
SendPoll
-
questionParseMode
Optional- Parameters:
questionParseMode- Mode for parsing entities in the question.- Returns:
SendPoll
-
questionEntities
Optional- Parameters:
questionEntities- A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode- Returns:
SendPoll
-
messageEffectId
Optional- Parameters:
messageEffectId- Unique identifier of the message effect to be added to the message; for private chats only- Returns:
SendPoll
-