Compare commits

...

3 Commits

Author SHA1 Message Date
Tyrrrz fdf421df3c Update version 2022-10-08 15:38:07 +03:00
Tyrrrz 2259f19c44 Remove message content intent check due to false positives 2022-10-08 15:35:06 +03:00
Tyrrrz 8695942328 Enforce a higher version of .NET runtime
Closes #941
2022-10-02 13:42:46 +03:00
5 changed files with 15 additions and 20 deletions
+5
View File
@@ -1,3 +1,8 @@
### v2.36.2 (08-Oct-2022)
- Removed the message content intent check because the heuristics turned out to be not reliable enough.
- Fixed an issue where the runtime manifest included the wrong target runtime version. This resulted in the application failing to launch for some users when upgrading from earlier versions.
### v2.36.1 (24-Sep-2022)
- Added a check which will trigger an error if the provided bot account does not have the message content intent enabled. Note, however, that this check is based on heuristics which may result in false negatives.
+9 -1
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>2.36.1</Version>
<Version>2.36.2</Version>
<Company>Tyrrrz</Company>
<Copyright>Copyright (c) Oleksii Holub</Copyright>
<LangVersion>preview</LangVersion>
@@ -10,4 +10,12 @@
<WarningsAsErrors>nullable</WarningsAsErrors>
</PropertyGroup>
<!--
Even though the project builds against .NET 6, some dependencies
apparently rely on a specific version of the runtime.
-->
<PropertyGroup>
<RuntimeFrameworkVersion>6.0.9</RuntimeFrameworkVersion>
</PropertyGroup>
</Project>
@@ -10,7 +10,7 @@ using JsonExtensions.Reading;
namespace DiscordChatExporter.Core.Discord.Data;
// https://discord.com/developers/docs/resources/channel#message-object
public partial record Message(
public record Message(
Snowflake Id,
MessageKind Kind,
User Author,
@@ -26,16 +26,6 @@ public partial record Message(
IReadOnlyList<User> MentionedUsers,
MessageReference? Reference,
Message? ReferencedMessage) : IHasId
{
public bool IsEmpty =>
Kind == MessageKind.Default &&
string.IsNullOrEmpty(Content) &&
!Attachments.Any() &&
!Embeds.Any() &&
!Stickers.Any();
}
public partial record Message
{
private static IReadOnlyList<Embed> NormalizeEmbeds(IReadOnlyList<Embed> embeds)
{
@@ -323,11 +323,6 @@ public class DiscordClient
if (message.Timestamp > lastMessage.Timestamp)
yield break;
// Make sure the messages are not empty when exporting via a bot
// https://github.com/Tyrrrz/DiscordChatExporter/issues/918
if (_resolvedTokenKind == TokenKind.Bot && message.IsEmpty && !message.Author.IsBot)
throw DiscordChatExporterException.MessageContentIntentMissing();
// Report progress based on the duration of exported messages divided by total
if (progress is not null)
{
@@ -41,7 +41,4 @@ Failed to perform an HTTP request.
internal static DiscordChatExporterException ChannelIsEmpty() =>
new("No messages found for the specified period.");
internal static DiscordChatExporterException MessageContentIntentMissing() =>
new("Failed to retrieve message content because the bot doesn't have the Message Content Intent enabled.");
}