explicit typing
This commit is contained in:
parent
5e58765cf4
commit
91ec2ece7e
|
@ -58,14 +58,14 @@ export default class VoteController {
|
||||||
public async handleReroll(voteMessage: VoteMessage, guild: Guild, guildId: string, requestId: string) {
|
public async handleReroll(voteMessage: VoteMessage, guild: Guild, guildId: string, requestId: string) {
|
||||||
|
|
||||||
//get movies that already had votes to give them a second chance
|
//get movies that already had votes to give them a second chance
|
||||||
const voteInfo = await this.parseVoteInfoFromVoteMessage(voteMessage, requestId)
|
const voteInfo: VoteMessageInfo = await this.parseVoteInfoFromVoteMessage(voteMessage, requestId)
|
||||||
|
|
||||||
// get movies from jellyfin to fill the remaining slots
|
// get movies from jellyfin to fill the remaining slots
|
||||||
const newMovieCount = config.bot.random_movie_count - voteInfo.votes.filter(x => x.count > 2).length
|
const newMovieCount: number = config.bot.random_movie_count - voteInfo.votes.filter(x => x.count > 2).length
|
||||||
const newMovies = await this.yavinJellyfinHandler.getRandomMovieNames(newMovieCount, guildId, requestId)
|
const newMovies: string[] = await this.yavinJellyfinHandler.getRandomMovieNames(newMovieCount, guildId, requestId)
|
||||||
|
|
||||||
// merge
|
// merge
|
||||||
const movies = newMovies.concat(voteInfo.votes.map(x => x.movie))
|
const movies: string[] = newMovies.concat(voteInfo.votes.map(x => x.movie))
|
||||||
|
|
||||||
// create new message
|
// create new message
|
||||||
await this.closePoll(guild, requestId)
|
await this.closePoll(guild, requestId)
|
||||||
|
|
Loading…
Reference in New Issue