def announce_round(self, round_name: str, round_url: str, round_color: util.Color): attach = { 'color': round_color.to_hex(), 'title': round_name, 'title_link': round_url, 'text': '*New round unlocked!*', 'mrkdwn_in': 'text', } self.log_and_send('Announcing round unlock', 'chat.postMessage', channel=self.unlocks_channel_id, username='******', icon_emoji=':robot_face:', attachments=[attach])
def announce_unlock(self, round_name: Optional[str], puzzle_name: str, puzzle_url: str, channel_name: str, channel_id: str, round_color: util.Color) -> None: lines = [] if round_name: lines.append(f'Round: {round_name}') lines.append(f'<#{channel_id}|{channel_name}>') attach = { 'color': round_color.to_hex(), 'title': puzzle_name, 'title_link': puzzle_url, 'text': '\n'.join(lines), } self.log_and_send('Announcing unlock', 'chat.postMessage', channel=self.unlocks_channel_id, username='******', icon_emoji=':robot_face:', attachments=[attach])