We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d8c6e89 commit 3a0f5ddCopy full SHA for 3a0f5dd
1 file changed
PasteMystBot/Services/MessagePastingService.cs
@@ -140,7 +140,9 @@ public async Task<bool> PasteMessageAttachmentsAsync(
140
141
foreach (DiscordAttachment attachment in message.Attachments)
142
{
143
- string content = await _httpClient.GetStringAsync(attachment.Url).ConfigureAwait(false);
+ await using Stream stream = await _httpClient.GetStreamAsync(attachment.Url).ConfigureAwait(false);
144
+ using var reader = new StreamReader(stream);
145
+ string content = await reader.ReadToEndAsync().ConfigureAwait(false);
146
string title = attachment.FileName;
147
var language = "Autodetect";
148
0 commit comments