forked from LagrangeDev/Lagrange.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |