This commit is contained in:
syuilo 2019-01-24 01:26:02 +09:00
parent 28826e145a
commit 834359be1d
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69

View file

@ -144,19 +144,24 @@ export default class extends Module {
} }
function acct(user: User): string { function acct(user: User): string {
return user.host ? `@${user.username}@${user.host}` : `@${user.username}`; return user.host
? `@${user.username}@${user.host}`
: `@${user.username}`;
} }
let results: string[] = []; let results: string[] = [];
let winner: User = null; let winner: User = null;
for (let i = 100; i >= 0; i--) { for (let i = 100; i >= 0; i--) {
const users = game.votes.filter(x => x.number == i).map(x => x.user); const users = game.votes
.filter(x => x.number == i)
.map(x => x.user);
if (users.length == 1) { if (users.length == 1) {
if (winner == null) { if (winner == null) {
winner = users[0]; winner = users[0];
results.push(`${i == 100 ? '💯' : '🎉'} **${i}**: ${acct(users[0])}`); const icon = i == 100 ? '💯' : '🎉';
results.push(`${icon} **${i}**: (((${acct(users[0])})))`);
} else { } else {
results.push(` ${i}: ${acct(users[0])}`); results.push(` ${i}: ${acct(users[0])}`);
} }