🐛 small change in order of operations
This commit is contained in:
@ -167,14 +167,13 @@ class ConnectFour():
|
||||
log_message = "They started a game"
|
||||
|
||||
self.bot.log(log_message)
|
||||
await ctx.send(send_message)
|
||||
|
||||
# Sets the whole game in motion
|
||||
if started_game:
|
||||
boards_path = "gwendolyn/resources/games/connect_four_boards/"
|
||||
file_path = f"{boards_path}board{ctx.channel_id}.png"
|
||||
image_message = await ctx.send(
|
||||
send_message, file=discord.File(file_path)
|
||||
)
|
||||
image_message = await ctx.send(file=discord.File(file_path))
|
||||
|
||||
board_string = self._encode_board_string(board)
|
||||
if gwendolyn_turn:
|
||||
@ -229,8 +228,6 @@ class ConnectFour():
|
||||
await image_message.edit(
|
||||
components=action_rows
|
||||
)
|
||||
else:
|
||||
await ctx.send(send_message)
|
||||
|
||||
async def place_piece(self, ctx: ComponentContext, board_string: str,
|
||||
column: int, players: list[int], difficulty: int,
|
||||
@ -242,6 +239,8 @@ class ConnectFour():
|
||||
column: int
|
||||
The column the player is placing the piece in.
|
||||
"""
|
||||
old_message = await ctx.channel.fetch_message(message_id)
|
||||
await old_message.delete()
|
||||
|
||||
player_number = players.index(placer)+1
|
||||
user_name = self.get_name(f"#{placer}")
|
||||
@ -286,6 +285,7 @@ class ConnectFour():
|
||||
placed_piece = True
|
||||
|
||||
self.bot.log(log_message)
|
||||
await ctx.channel.send(send_message)
|
||||
|
||||
if placed_piece:
|
||||
channel = str(ctx.channel)
|
||||
@ -295,8 +295,7 @@ class ConnectFour():
|
||||
|
||||
boards_path = "gwendolyn/resources/games/connect_four_boards/"
|
||||
file_path = boards_path + f"board{channel}.png"
|
||||
image_message = await ctx.channel.send(
|
||||
send_message, file=discord.File(file_path))
|
||||
image_message = await ctx.channel.send(file=discord.File(file_path))
|
||||
|
||||
if game_won:
|
||||
self._end_game(winner, players, difficulty)
|
||||
@ -355,11 +354,7 @@ class ConnectFour():
|
||||
await image_message.edit(
|
||||
components=action_rows
|
||||
)
|
||||
else:
|
||||
await ctx.channel.send(send_message)
|
||||
|
||||
old_message = await ctx.channel.fetch_message(message_id)
|
||||
await old_message.delete()
|
||||
|
||||
async def surrender(self, ctx: ComponentContext, players: list,
|
||||
difficulty: int, message_id: int):
|
||||
|
Reference in New Issue
Block a user