Skip to content

Commit

Permalink
convert by uri
Browse files Browse the repository at this point in the history
  • Loading branch information
NepPure committed Jan 15, 2024
1 parent 7e05f7d commit eae4ac3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Lagrange.OneBot/Core/Message/Entity/ImageSegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ public void Build(MessageBuilder builder, ISegment segment)

if (imageSegment.Url.StartsWith("file"))
{
// see: https://github.com/LagrangeDev/Lagrange.Core/issues/69
string path = imageSegment.Url.Replace("file:///", "");
path = path.Replace("file://", "");
path = path.Replace("file:/", "");
string path = new Uri(imageSegment.Url).AbsolutePath;
builder.Image(File.ReadAllBytes(path));
}

Expand Down

0 comments on commit eae4ac3

Please sign in to comment.