Hey, I was curious How could I add an Image Attachment into ths?
builder.ConfigureEventHandlers
(
fetchcard => fetchcard.HandleMessageCreated(async (s, e) =>
{
string message = e.Message.Content;
MatchCollection matches = Regex.Matches(message, @"\[\[(.*?)\]\]");
List<string> extractedContents = new List<string>();
foreach (Match match in matches)
{
extractedContents.Add(match.Groups[1].Value.Trim()); // Trim extracted content
}
if (extractedContents.Count > 0)
{
string output = "The Outputs are as follows:";
foreach (string content in extractedContents)
{
logger.Info(content);
// Compare with trimmed content and case-insensitive
if (NotionEnd.CtiCardNames.Contains(content, StringComparer.OrdinalIgnoreCase))
{
output += "\ntrue\n";
var carddictinaryvalue = NotionEnd.CtiCards.GetValueOrDefault(content);
var pagefetchresults = await NotionPageFetcher.FetchPageInfo(content, "card");
var textnimages = await FetchImageAndParagraph.FetchTextandImage(pagefetchresults.textBlocks, pagefetchresults.imageUrls);
output += textnimages.textBlocks;
}
else
{
output += "\nfalse";
}
}
await e.Message.RespondAsync(output);
}
})
);