mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-01-28 22:01:55 +00:00
Clean up
This commit is contained in:
@@ -8,14 +8,20 @@ internal static class HtmlMessageExtensions
|
|||||||
{
|
{
|
||||||
// Message content is hidden if it's a link to an embedded media
|
// Message content is hidden if it's a link to an embedded media
|
||||||
// https://github.com/Tyrrrz/DiscordChatExporter/issues/682
|
// https://github.com/Tyrrrz/DiscordChatExporter/issues/682
|
||||||
public static bool IsContentHidden(this Message message)
|
extension(Message message)
|
||||||
|
{
|
||||||
|
public bool IsContentHidden()
|
||||||
{
|
{
|
||||||
if (message.Embeds.Count != 1)
|
if (message.Embeds.Count != 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var embed = message.Embeds[0];
|
var embed = message.Embeds[0];
|
||||||
|
|
||||||
return string.Equals(message.Content.Trim(), embed.Url, StringComparison.OrdinalIgnoreCase)
|
return string.Equals(
|
||||||
&& embed.Kind is EmbedKind.Image or EmbedKind.Gifv;
|
message.Content.Trim(),
|
||||||
|
embed.Url,
|
||||||
|
StringComparison.OrdinalIgnoreCase
|
||||||
|
) && embed.Kind is EmbedKind.Image or EmbedKind.Gifv;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ namespace DiscordChatExporter.Core.Exporting;
|
|||||||
|
|
||||||
internal static class PlainTextMessageExtensions
|
internal static class PlainTextMessageExtensions
|
||||||
{
|
{
|
||||||
public static string GetFallbackContent(this Message message) =>
|
extension(Message message)
|
||||||
|
{
|
||||||
|
public string GetFallbackContent() =>
|
||||||
message.Kind switch
|
message.Kind switch
|
||||||
{
|
{
|
||||||
MessageKind.RecipientAdd => message.MentionedUsers.Any()
|
MessageKind.RecipientAdd => message.MentionedUsers.Any()
|
||||||
@@ -41,3 +43,4 @@ internal static class PlainTextMessageExtensions
|
|||||||
_ => message.Content,
|
_ => message.Content,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user