Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update game_handler.py #641

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions zulip_bots/zulip_bots/game_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def command_quit(self, message: Dict[str, Any], sender: str, content: str) -> No
if game_id == '':
self.send_reply(
message, 'You are not in a game. Type `help` for all commands.')
sender_avatar = "!avatar({})".format(sender)
sender_avatar = "<i>avatar</i>({})".format(sender)
sender_name = self.get_username_by_email(sender)
self.cancel_game(game_id, reason='{} **{}** quit.'.format(sender_avatar, sender_name))

Expand Down Expand Up @@ -556,7 +556,7 @@ def get_number_of_players(self, game_id: str) -> int:

def get_host(self, game_id: str) -> str:
player_email = self.get_players(game_id)[0]
player_avatar = "!avatar({})".format(player_email)
player_avatar = "<i>avatar</i>({})".format(player_email)
return player_avatar

def parse_message(self, message: Dict[str, Any]) -> None:
Expand Down Expand Up @@ -825,7 +825,7 @@ def handle_message(self, content: str, player_email: str) -> None:
if self.gameAdapter.is_single_player:
self.broadcast('It\'s your turn')
else:
user_turn_avatar = "!avatar({})".format(self.players[self.turn])
user_turn_avatar = "<i>avatar</i>({})".format(self.players[self.turn])
self.broadcast('{} It\'s **{}**\'s ({}) turn.'.format(
user_turn_avatar,
self.gameAdapter.get_username_by_email(
Expand Down Expand Up @@ -889,7 +889,7 @@ def same_player_turn(self, content: str, message: str, is_computer: bool) -> Non
game_over = self.players[self.turn]
self.end_game(game_over)
return
user_turn_avatar = "!avatar({})".format(self.players[self.turn])
user_turn_avatar = "<i>avatar</i>({})".format(self.players[self.turn])
self.current_messages.append('{} It\'s **{}**\'s ({}) turn.'.format(
user_turn_avatar,
self.gameAdapter.get_username_by_email(self.players[self.turn]),
Expand All @@ -906,7 +906,7 @@ def next_turn(self) -> None:
if self.gameAdapter.is_single_player:
self.current_messages.append('It\'s your turn.')
else:
user_turn_avatar = "!avatar({})".format(self.players[self.turn])
user_turn_avatar = "<i>avatar</i>({})".format(self.players[self.turn])
self.current_messages.append('{} It\'s **{}**\'s ({}) turn.'.format(
user_turn_avatar,
self.gameAdapter.get_username_by_email(self.players[self.turn]),
Expand All @@ -931,7 +931,7 @@ def end_game(self, winner: str) -> None:
elif winner.startswith('except:'):
loser = winner.lstrip('except:')
else:
winner_avatar = "!avatar({})".format(winner)
winner_avatar = "<i>avatar</i>({})".format(winner)
winner_name = self.gameAdapter.get_username_by_email(winner)
self.broadcast('{} **{}** won! :tada:'.format(winner_avatar, winner_name))
for u in self.players:
Expand Down