Skip to content

Commit

Permalink
Merge pull request #79 from murpii/pr_change_map_reset_from_evaluated…
Browse files Browse the repository at this point in the history
…_maps

Set bot as initial_ready if map channel got reset from evaluated maps
  • Loading branch information
def- authored Feb 9, 2024
2 parents d595216 + d743f06 commit d3199f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cogs/map_testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ async def handle_submission(self, message: discord.Message):
subm = Submission(message)
if map_channel.filename == str(subm):
by_mapper = str(author.id) in map_channel.mapper_mentions
# set bot as initial ready so the map only needs one ready to be moved to evaluated maps again
initial_ready = self.bot.user.mention
if by_mapper and map_channel.state in (MapState.WAITING, MapState.READY):
await map_channel.set_state(state=MapState.TESTING)
await map_channel.set_state(state=MapState.RC, ready_state_set_by=initial_ready)

if by_mapper or is_staff(author) or author == self.bot.user:
await self.upload_submission(subm)
Expand Down
2 changes: 1 addition & 1 deletion cogs/map_testing/map_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async def set_state(self, *, state: MapState, ready_state_set_by: str = None):

if category_id != self.category_id:
options['category'] = category = self.guild.get_channel(category_id)
options['position'] = category.channels[-1].position + 1 if state is MapState.TESTING else 0
options['position'] = category.channels[-1].position + 1 if state in [MapState.TESTING, MapState.RC] else 0

options['topic'] = f"{self.topic}"

Expand Down

0 comments on commit d3199f3

Please sign in to comment.