Browse Source

reports ids url to same

master
gsd 3 weeks ago
parent
commit
a861889020
  1. 12
      other_ext/kamaz_ai.py

12
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:

Loading…
Cancel
Save