Interface PollModule
- All Superinterfaces:
org.incendo.cloud.execution.CommandExecutionHandler<FPlayer>, ModuleCommand, ModuleLocalization, ModuleSimple
The /poll command, which runs a vote in chat.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumWhat was done to a poll, either created, re-announced, or voted on.static enumHow far a poll has got, either just announced, running, or closed.Nested classes/interfaces inherited from interface org.incendo.cloud.execution.CommandExecutionHandler
org.incendo.cloud.execution.CommandExecutionHandler.FutureCommandExecutionHandler<C> -
Method Summary
Modifier and TypeMethodDescriptionconfig()The config section for this command, which also holds its aliases.voidcreatePoll(FPlayer fPlayer, String title, boolean multipleValue, long endTimeValue, long repeatTimeValue, List<String> answers) Starts a poll and announces it.voidexecuteVote(FPlayer fPlayer, org.incendo.cloud.context.CommandContext<FPlayer> commandContext) Runs the voting form of the command.localization(FPlayer fPlayer) The localization section for a player, picked from their chosen language.The permission that gates this module.net.kyori.adventure.text.minimessage.tag.resolver.TagResolver[]resolveAnswerTags(FEntity sender, FPlayer fReceiver, Poll poll) The answers of a poll, each as its own tagresolvePollFormat(FPlayer fPlayer, Poll poll, PollModule.Status status) The rendered poll, laid out for the stage it has reached.resolveVote(FPlayer fPlayer, int voteType, int answerID, int pollID, int count) The wording confirming a vote.voidsaveAndUpdateLast(Poll poll) Stores a poll and makes it the one an unqualified vote applies to.voidRecords a vote and announces the new tally.Methods inherited from interface org.incendo.cloud.execution.CommandExecutionHandler
executeFutureMethods inherited from interface ModuleCommand
execute, executeMethods inherited from interface ModuleLocalization
cooldown, cooldownOrThrow, permissions, sound, soundOrThrow
-
Method Details
-
executeVote
-
config
Command.Poll config()Description copied from interface:ModuleCommandThe config section for this command, which also holds its aliases.- Specified by:
configin interfaceModuleCommand- Specified by:
configin interfaceModuleSimple- Returns:
- the command settings
-
permission
Permission.Command.Poll permission()Description copied from interface:ModuleSimpleThe permission that gates this module.- Specified by:
permissionin interfaceModuleSimple- Returns:
- the permission
-
localization
Description copied from interface:ModuleLocalizationThe localization section for a player, picked from their chosen language.- Specified by:
localizationin interfaceModuleLocalization- Parameters:
fPlayer- the player the text is for- Returns:
- the localization settings
-
createPoll
void createPoll(FPlayer fPlayer, String title, boolean multipleValue, long endTimeValue, long repeatTimeValue, List<String> answers) Starts a poll and announces it.- Parameters:
fPlayer- who started ittitle- the questionmultipleValue- whether a voter may pick several answersendTimeValue- how long voting stays open, in millisecondsrepeatTimeValue- how often the poll is re-announced, in millisecondsanswers- the options to vote on
-
saveAndUpdateLast
Stores a poll and makes it the one an unqualified vote applies to.- Parameters:
poll- the poll
-
vote
-
resolveVote
The wording confirming a vote.- Parameters:
fPlayer- the readervoteType- whether the vote was cast, changed or withdrawnanswerID- the chosen optionpollID- the poll idcount- the votes that option now has- Returns:
- the confirmation text
-
resolvePollFormat
The rendered poll, laid out for the stage it has reached.- Parameters:
fPlayer- the readerpoll- the pollstatus- the stage- Returns:
- the rendered poll
-
resolveAnswerTags
-