Skip to content

Commit

Permalink
greytip
Browse files Browse the repository at this point in the history
  • Loading branch information
sisi0318 committed Oct 8, 2024
1 parent a629dcc commit 2ca2363
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Lagrange.OneBot/Message/Entity/GreyTipSegment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Text.Json.Serialization;
using Lagrange.Core.Message;
using Lagrange.Core.Message.Entity;

namespace Lagrange.OneBot.Message.Entity;

[Serializable]
public partial class GreyTipSegment(string content)
{
public GreyTipSegment(): this("") {}

[JsonPropertyName("content")] [CQProperty] public string Content { get; set; } = content;
}

[SegmentSubscriber(typeof(GreyTipEntity), "greytip")]
public partial class GreyTipSegment : SegmentBase
{
public override void Build(MessageBuilder builder, SegmentBase segment)
{
if (segment is GreyTipSegment greyTip) builder.GeryTip(greyTip.Content);
}

public override SegmentBase? FromEntity(MessageChain chain, IMessageEntity entity)
{
return null;
}
}

0 comments on commit 2ca2363

Please sign in to comment.