Skip to content
Draft
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
11 changes: 5 additions & 6 deletions src/app/services/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def notify(self, slack_hook: str, message_detection: str, url: str, camera_name:

if url is not None:
message = {
"text": "Un feu a été detecté !",
"text": "A fire has been detected",
Copy link
Member

@MateoLostanlen MateoLostanlen Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why in english ? should keep everything in french for now. then you should add translation based on region

"blocks": [
{
"type": "section",
Expand All @@ -73,12 +73,12 @@ def notify(self, slack_hook: str, message_detection: str, url: str, camera_name:
+ "\n Azimuth de detection : "
+ str(azimuth)
+ "°"
+ "\n https://platform.pyronear.org/"
+ "\n <https://platform.pyronear.org/|Visualiser le détail de l'alerte sur la plateforme Pyronear>\n"
+ "\n "
+ url,
+ f"<{url}|Télécharger l'image>",
},
},
{"type": "image", "image_url": url, "alt_text": "Haunted hotel image"},
{"type": "image", "image_url": url, "alt_text": "alert image"},
],
}
else:
Expand All @@ -97,7 +97,7 @@ def notify(self, slack_hook: str, message_detection: str, url: str, camera_name:
+ "\n Azimuth de detection : "
+ str(azimuth)
+ "°"
+ "\n https://platform.pyronear.org/",
+ "\n <https://platform.pyronear.org/|Visualiser le détail de l'alerte sur la plateforme>\n",
},
},
],
Expand All @@ -110,7 +110,6 @@ def notify(self, slack_hook: str, message_detection: str, url: str, camera_name:
headers={"Content-Type": "application/json"},
timeout=3,
)

if response.status_code != 200:
logger.error(f"Failed to send message to Slack: {response.text}")

Expand Down
Loading