Skip to content

Commit

Permalink
Change seen emoji to reviewed emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
wookie184 committed Jun 19, 2021
1 parent bd1ee16 commit 4bd92ca
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions bot/exts/recruitment/talentpool/_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def schedule_review(self, user_id: int) -> None:

async def post_review(self, user_id: int, update_database: bool) -> None:
"""Format the review of a user and post it to the nomination voting channel."""
review, seen_emoji = await self.make_review(user_id)
review, reviewed_emoji = await self.make_review(user_id)
if not review:
return

Expand All @@ -88,16 +88,16 @@ async def post_review(self, user_id: int, update_database: bool) -> None:
await pin_no_system_message(messages[0])

last_message = messages[-1]
if seen_emoji:
for reaction in (seen_emoji, "\N{THUMBS UP SIGN}", "\N{THUMBS DOWN SIGN}"):
if reviewed_emoji:
for reaction in (reviewed_emoji, "\N{THUMBS UP SIGN}", "\N{THUMBS DOWN SIGN}"):
await last_message.add_reaction(reaction)

if update_database:
nomination = self._pool.watched_users.get(user_id)
await self.bot.api_client.patch(f"{self._pool.api_endpoint}/{nomination['id']}", json={"reviewed": True})

async def make_review(self, user_id: int) -> typing.Tuple[str, Optional[Emoji]]:
"""Format a generic review of a user and return it with the seen emoji."""
"""Format a generic review of a user and return it with the reviewed emoji."""
log.trace(f"Formatting the review of {user_id}")

# Since `watched_users` is a defaultdict, we should take care
Expand Down Expand Up @@ -127,15 +127,15 @@ async def make_review(self, user_id: int) -> typing.Tuple[str, Optional[Emoji]]:

review_body = await self._construct_review_body(member)

seen_emoji = self._random_ducky(guild)
reviewed_emoji = self._random_ducky(guild)
vote_request = (
"*Refer to their nomination and infraction histories for further details*.\n"
f"*Please react {seen_emoji} if you've seen this post."
" Then react :+1: for approval, or :-1: for disapproval*."
f"*Please react {reviewed_emoji} once you have reviewed this user,"
" and react :+1: for approval, or :-1: for disapproval*."
)

review = "\n\n".join((opening, current_nominations, review_body, vote_request))
return review, seen_emoji
return review, reviewed_emoji

async def archive_vote(self, message: PartialMessage, passed: bool) -> None:
"""Archive this vote to #nomination-archive."""
Expand Down Expand Up @@ -163,7 +163,7 @@ async def archive_vote(self, message: PartialMessage, passed: bool) -> None:
user_id = int(MENTION_RE.search(content).group(1))

# Get reaction counts
seen = await count_unique_users_reaction(
reviewed = await count_unique_users_reaction(
messages[0],
lambda r: "ducky" in str(r) or str(r) == "\N{EYES}",
count_bots=False
Expand All @@ -188,7 +188,7 @@ async def archive_vote(self, message: PartialMessage, passed: bool) -> None:

embed_content = (
f"{result} on {timestamp}\n"
f"With {seen} {Emojis.ducky_dave} {upvotes} :+1: {downvotes} :-1:\n\n"
f"With {reviewed} {Emojis.ducky_dave} {upvotes} :+1: {downvotes} :-1:\n\n"
f"{stripped_content}"
)

Expand Down Expand Up @@ -357,7 +357,7 @@ async def _previous_nominations_review(self, member: Member) -> Optional[str]:

@staticmethod
def _random_ducky(guild: Guild) -> Union[Emoji, str]:
"""Picks a random ducky emoji to be used to mark the vote as seen. If no duckies found returns :eyes:."""
"""Picks a random ducky emoji. If no duckies found returns :eyes:."""
duckies = [emoji for emoji in guild.emojis if emoji.name.startswith("ducky")]
if not duckies:
return ":eyes:"
Expand Down

0 comments on commit 4bd92ca

Please sign in to comment.