Skip to content

Commit

Permalink
feat: use simplify_response
Browse files Browse the repository at this point in the history
  • Loading branch information
FuseFairy committed Jun 21, 2023
1 parent 7388c81 commit 6491452
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cogs/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,17 @@ async def send_message(chatbot: Chatbot, message, user_message: str):
await message.followup.send(temp)
else:
await message.channel.send(temp)

# Get the image, if available
try:
if reply["item"]["messages"][2]["contentType"] == "IMAGE":
all_image = re.findall("https?://[\w\./]+", str(reply["item"]["messages"][1]["adaptiveCards"][0]["body"][0]["text"]))
if len(link_embed) == 0:
all_image = re.findall("https?://[\w\./]+", str(reply["sources_text"]))
[images_embed.append(discord.Embed(url="https://www.bing.com/").set_image(url=image_link)) for image_link in all_image]
except:
pass

if USE_SUGGEST_RESPONSES:
suggest_responses = reply["suggestions"]

if images_embed:
if isinstance(message, discord.interactions.Interaction):
await message.followup.send(response, view=MyView(chatbot, suggest_responses), embeds=images_embed, wait=True)
Expand Down

0 comments on commit 6491452

Please sign in to comment.