[OneBot] code refactor of ImageSegment.cs

This commit is contained in:
Linwenxuan 2023-10-18 10:31:33 +08:00
parent 63f0ffaeac
commit a9a554dbf4
1 changed files with 13 additions and 16 deletions

View File

@ -21,9 +21,7 @@ public partial class ImageSegment : ISegment
public void Build(MessageBuilder builder, ISegment segment)
{
if (segment is ImageSegment imageSegment)
{
if (imageSegment is not { Url: "" })
if (segment is ImageSegment imageSegment and not { Url: "" })
{
if (imageSegment.Url.StartsWith("http"))
{
@ -43,7 +41,6 @@ public partial class ImageSegment : ISegment
}
}
}
}
public ISegment FromEntity(IMessageEntity entity)
{