Skip to content

Commit

Permalink
Show nominated mottos in leaderboard too
Browse files Browse the repository at this point in the history
  • Loading branch information
benbacardi committed Jul 23, 2021
1 parent 6084532 commit f2f2684
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion botto/MottoBotto.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ async def process_dm(self, message: Message):
else position
)
plural = "s" if leader.motto_count > 1 else ""
leaders_message = f"{leaders_message}:{NUMBERS[pos]}: <@{leader.discord_id}> {leader.display_name} ({leader.motto_count} motto{plural})\n"
leaders_message = f"{leaders_message}:{NUMBERS[pos]}: <@{leader.discord_id}> {leader.display_name} ({leader.motto_count} motto{plural}, {leader.nominated_motto_count} nominated)\n"
if previous_count != leader.motto_count:
previous_count = leader.motto_count
previous_position = position
Expand Down
4 changes: 4 additions & 0 deletions botto/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ class Member(Model):
"nickname",
"use_nickname",
"motto_count",
"nominated_motto_count",
"total_score",
"bot_id",
"mottos",
]
Expand All @@ -105,6 +107,8 @@ def from_airtable(cls, data: dict) -> "Member":
nickname=fields.get("Nickname"),
use_nickname=fields.get("Use Nickname", False),
motto_count=fields.get("Motto Count", 0),
nominated_motto_count=fields.get("Nominated Motto Count", 0),
total_score=fields.get("Total Score", 0),
bot_id=fields.get("Bot ID", None),
mottos=fields.get("Mottos", []),
)
Expand Down

0 comments on commit f2f2684

Please sign in to comment.