Skip to content

Commit

Permalink
Fixed chain bonus drop notification
Browse files Browse the repository at this point in the history
Signed-off-by: tiksan <[email protected]>
  • Loading branch information
dssecret committed Feb 8, 2025
1 parent c5a35fc commit d283d99
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions celery/tornium_celery/tasks/faction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ def check_attacks(faction_data: dict, last_attacks: int):
if attack["attacker_id"] in (0, ""):
attacker_str = "an unknown attacker and faction"
else:
attacker_str = f"{attack['attacker_factionname']} [{attack['attacker_faction']}] (through {attack['attacker_name']} [{attack['attacker']}])"
attacker_str = f"{attack['attacker_factionname']} [{attack['attacker_faction']}] (through {attack['attacker_name']} [{attack['attacker_id']}])"

payload = {
"embeds": [
Expand All @@ -1277,12 +1277,6 @@ def check_attacks(faction_data: dict, last_attacks: int):
{
"type": 1,
"components": [
{
"type": 2,
"style": 5,
"label": "Attacking Faction",
"url": f"https://www.torn.com/factions.php?step=profile&ID={attack['attacker_faction']}",
},
{
"type": 2,
"style": 5,
Expand All @@ -1295,7 +1289,14 @@ def check_attacks(faction_data: dict, last_attacks: int):
}

if attack["attacker_id"] not in (0, ""):
payload["components"].append()
payload["components"][0]["components"].append(
{
"type": 2,
"style": 5,
"label": "Attacking Faction",
"url": f"https://www.torn.com/factions.php?step=profile&ID={attack['attacker_faction']}",
}
)

for role in attack_config.chain_bonus_roles:
if "content" not in payload:
Expand Down

0 comments on commit d283d99

Please sign in to comment.