From a861889020eb01861216c12c238360e6e5e487ab Mon Sep 17 00:00:00 2001 From: gsd Date: Sat, 13 Jun 2026 00:39:30 +0300 Subject: [PATCH] reports ids url to same --- other_ext/kamaz_ai.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/other_ext/kamaz_ai.py b/other_ext/kamaz_ai.py index c5d903d..faa1aa2 100644 --- a/other_ext/kamaz_ai.py +++ b/other_ext/kamaz_ai.py @@ -480,7 +480,13 @@ class Extension: result = await self.kamazai.predict(report) suggestions = result.get("suggestions", [{"confidence":1, "action": "none"}]) - embed: discord.Embed = discord.Embed(description="Решил что с этим репортом надо сделать") + + same_reports = [] + same_reports.append(str(report_id)) + for s in result.get("similar_reports", []): + same_reports.append(str(s)) + + embed: discord.Embed = discord.Embed(description="Решил что с этим репортом надо сделать (нажми на меня чтобы увидеть похожие репорты)", url=f"{os.getenv('BACKEND_URL')}/#/reports?page=0&size=10&ids={','.join(same_reports)}") embed.set_author(name="Камаз AI", icon_url="https://media.istockphoto.com/id/532124854/ru/%D0%B2%D0%B5%D0%BA%D1%82%D0%BE%D1%80%D0%BD%D0%B0%D1%8F/%D0%B5%D0%B2%D1%80%D0%B5%D0%B9%D1%81%D0%BA%D0%B8%D0%B9-%D1%80%D0%BE%D0%B1%D0%BE%D1%82-%D0%BF%D0%B5%D1%80%D1%81%D0%BE%D0%BD%D0%B0%D0%B6%D0%B0.jpg?s=170667a&w=0&k=20&c=3n1zIaQ0zd36upFONeofKPVioEf5JfFnDs6gShydAvw=") for ss in suggestions: if ss["action"] == "noreason": @@ -491,10 +497,6 @@ class Extension: value=f'{self.actions.get(ss["action"], [ss["action"], 100])[0]}', inline=False) - same_reports = [] - same_reports.append(str(report_id)) - for s in result.get("similar_reports", []): - same_reports.append(str(s)) embed.set_footer(text=",".join(same_reports)) response = await message.reply(embed=embed) try: