feat: Add hero name translation for match report embeds
This commit is contained in:
parent
e2c6c9ea5b
commit
2bae19643a
2
dota.py
2
dota.py
@ -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,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user