Class VotingCheckingService<T extends VotePayload>
java.lang.Object
de.chojo.jdautil.botlist.modules.shared.RouteProvider
de.chojo.jdautil.botlist.modules.voting.poll.VotingCheckingService<T>
- Type Parameters:
T- type of the response
- All Implemented Interfaces:
VoteChecker
public class VotingCheckingService<T extends VotePayload>
extends RouteProvider
implements VoteChecker
Checks votes by calling a vote check endpoint of the bot list.
Answers are cached per list and user for one minute, so a busy bot stays below the rate limits of the lists. Failed requests and error responses count as "not voted" and are not cached.
-
Constructor Summary
ConstructorsConstructorDescriptionVotingCheckingService(String route, Class<T> response) Creates a new vote checker. -
Method Summary
Methods inherited from class RouteProvider
route
-
Constructor Details
-
VotingCheckingService
-
-
Method Details
-
hasVoted
Description copied from interface:VoteCheckerChecks whether the user has an active vote on the bot list.- Specified by:
hasVotedin interfaceVoteChecker- Parameters:
botList- bot list to askuser- user to check- Returns:
- true when the user has an active vote
-