diff options
| author | 2021-03-28 09:52:53 +0300 | |
|---|---|---|
| committer | 2021-03-28 09:52:53 +0300 | |
| commit | 4716b8eba3d25f21e277ee20cff2741cece2e0ed (patch) | |
| tree | 444cf52798a109a6ee5f115b83f49cc68d264392 | |
| parent | Add missing asterisk to nominees list (diff) | |
Migrate nomination reasons editing commands
| -rw-r--r-- | bot/exts/recruitment/talentpool/_cog.py | 20 | 
1 files changed, 10 insertions, 10 deletions
diff --git a/bot/exts/recruitment/talentpool/_cog.py b/bot/exts/recruitment/talentpool/_cog.py index 4ef3af3d1..7824d22d7 100644 --- a/bot/exts/recruitment/talentpool/_cog.py +++ b/bot/exts/recruitment/talentpool/_cog.py @@ -267,10 +267,10 @@ class TalentPool(Cog, name="Talentpool"):              return          try: -            nomination = await self.bot.api_client.get(f"{self.api_endpoint}/{nomination_id}") +            nomination = await self.bot.api_client.get(f"bot/nominations/{nomination_id}")          except ResponseCodeError as e:              if e.response.status == 404: -                self.log.trace(f"Nomination API 404: Can't find a nomination with id {nomination_id}") +                log.trace(f"Nomination API 404: Can't find a nomination with id {nomination_id}")                  await ctx.send(f":x: Can't find a nomination with id `{nomination_id}`")                  return              else: @@ -284,13 +284,13 @@ class TalentPool(Cog, name="Talentpool"):              await ctx.send(f":x: {actor} doesn't have an entry in this nomination.")              return -        self.log.trace(f"Changing reason for nomination with id {nomination_id} of actor {actor} to {repr(reason)}") +        log.trace(f"Changing reason for nomination with id {nomination_id} of actor {actor} to {repr(reason)}")          await self.bot.api_client.patch( -            f"{self.api_endpoint}/{nomination_id}", +            f"bot/nominations/{nomination_id}",              json={"actor": actor.id, "reason": reason}          ) -        await self.fetch_user_cache()  # Update cache +        await self.refresh_cache()  # Update cache          await ctx.send(":white_check_mark: Successfully updated nomination reason.")      @nomination_edit_group.command(name='end_reason') @@ -302,10 +302,10 @@ class TalentPool(Cog, name="Talentpool"):              return          try: -            nomination = await self.bot.api_client.get(f"{self.api_endpoint}/{nomination_id}") +            nomination = await self.bot.api_client.get(f"bot/nominations/{nomination_id}")          except ResponseCodeError as e:              if e.response.status == 404: -                self.log.trace(f"Nomination API 404: Can't find a nomination with id {nomination_id}") +                log.trace(f"Nomination API 404: Can't find a nomination with id {nomination_id}")                  await ctx.send(f":x: Can't find a nomination with id `{nomination_id}`")                  return              else: @@ -315,13 +315,13 @@ class TalentPool(Cog, name="Talentpool"):              await ctx.send(":x: Can't edit the end reason of an active nomination.")              return -        self.log.trace(f"Changing end reason for nomination with id {nomination_id} to {repr(reason)}") +        log.trace(f"Changing end reason for nomination with id {nomination_id} to {repr(reason)}")          await self.bot.api_client.patch( -            f"{self.api_endpoint}/{nomination_id}", +            f"bot/nominations/{nomination_id}",              json={"end_reason": reason}          ) -        await self.fetch_user_cache()  # Update cache. +        await self.refresh_cache()  # Update cache.          await ctx.send(":white_check_mark: Updated the end reason of the nomination!")      @nomination_group.command(aliases=('mr',))  |