Skip to content

Commit

Permalink
Merge pull request #66 from teknologi-umum/feat/ai-markdown
Browse files Browse the repository at this point in the history
Change AI parse mode to MarkdownV2
  • Loading branch information
ronnygunawan authored Oct 30, 2023
2 parents abef016 + 71a21c3 commit 6daab2a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions BotNet.Services/BotCommands/OpenAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,23 +386,23 @@ await botClient.SendTextMessageAsync(
if (attachments.Count == 0) {
return await botClient.SendTextMessageAsync(
chatId: message.Chat.Id,
text: WebUtility.HtmlEncode(result),
parseMode: ParseMode.Html,
text: result,
parseMode: ParseMode.MarkdownV2,
replyToMessageId: message.MessageId,
cancellationToken: cancellationToken);
} else if (attachments.Count == 1) {
return await botClient.SendPhotoAsync(
chatId: message.Chat.Id,
photo: new InputOnlineFile(attachments[0]),
caption: WebUtility.HtmlEncode(result),
parseMode: ParseMode.Html,
caption: result,
parseMode: ParseMode.MarkdownV2,
replyToMessageId: message.MessageId,
cancellationToken: cancellationToken);
} else {
Message sentMessage = await botClient.SendTextMessageAsync(
chatId: message.Chat.Id,
text: WebUtility.HtmlEncode(result),
parseMode: ParseMode.Html,
text: result,
parseMode: ParseMode.MarkdownV2,
replyToMessageId: message.MessageId,
cancellationToken: cancellationToken);
await botClient.SendMediaGroupAsync(
Expand Down Expand Up @@ -458,23 +458,23 @@ await botClient.SendTextMessageAsync(
if (attachments.Count == 0) {
return await botClient.SendTextMessageAsync(
chatId: message.Chat.Id,
text: WebUtility.HtmlEncode(result),
parseMode: ParseMode.Html,
text: result,
parseMode: ParseMode.MarkdownV2,
replyToMessageId: message.MessageId,
cancellationToken: cancellationToken);
} else if (attachments.Count == 1) {
return await botClient.SendPhotoAsync(
chatId: message.Chat.Id,
photo: new InputOnlineFile(attachments[0]),
caption: WebUtility.HtmlEncode(result),
parseMode: ParseMode.Html,
caption: result,
parseMode: ParseMode.MarkdownV2,
replyToMessageId: message.MessageId,
cancellationToken: cancellationToken);
} else {
Message sentMessage = await botClient.SendTextMessageAsync(
chatId: message.Chat.Id,
text: WebUtility.HtmlEncode(result),
parseMode: ParseMode.Html,
text: result,
parseMode: ParseMode.MarkdownV2,
replyToMessageId: message.MessageId,
cancellationToken: cancellationToken);
await botClient.SendMediaGroupAsync(
Expand Down

0 comments on commit 6daab2a

Please sign in to comment.