feat: Add hero name translation for match report embeds
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ching L 2025-03-05 18:30:50 +08:00
parent 269f47fc6c
commit a2de839a6d

View File

@ -167,7 +167,7 @@ class Friend(BaseModel):
# start_time = datetime.datetime.fromtimestamp(match_['start_time']).strftime('%Y-%m-%dT%H:%M:%S.000+08:00') # start_time = datetime.datetime.fromtimestamp(match_['start_time']).strftime('%Y-%m-%dT%H:%M:%S.000+08:00')
end_time = datetime.datetime.fromtimestamp(match_['end_time']).strftime('%Y-%m-%dT%H:%M:%S.000+08:00') end_time = datetime.datetime.fromtimestamp(match_['end_time']).strftime('%Y-%m-%dT%H:%M:%S.000+08:00')
hero_name = Hero.get(hero_id=match_['hero_id']).localized_name hero_name = utils.get_hero_chinese_name(Hero.get(hero_id=match_['hero_id']).localized_name)
data['embeds'].append({ data['embeds'].append({
'title': f"{hero_name} {match_['kills']}{match_['deaths']}{match_['assists']}", 'title': f"{hero_name} {match_['kills']}{match_['deaths']}{match_['assists']}",
'description': summary, 'description': summary,