Fix connect_4 message data

This commit is contained in:
AlberLC
2023-04-25 06:44:52 +02:00
parent ad98464446
commit 336d8f8b8a

View File

@@ -284,8 +284,8 @@ class Connect4Bot(MultiBot, ABC):
return False
try:
message.data['is_active'] = False
except AttributeError:
message.data['connect_4']['is_active'] = False
except KeyError:
pass
await self.edit(
@@ -448,7 +448,7 @@ class Connect4Bot(MultiBot, ABC):
return winners
def _winning_positions(self, board: list[list[int | None]]) -> defaultdict[int, list[tuple[int, int]]]:
winning_positions = defaultdict(list)
winning_positions: defaultdict[int, list[tuple[int, int]]] = defaultdict(list)
for next_i, next_j in self._available_positions(board):
for player_number in self._check_winners(next_i, next_j, board):
winning_positions[player_number].append((next_i, next_j))