-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [Core] Add message style * add and remove some fields in MessageStyleExtra.cs * en summary * Use ulong type for BubbleId and PendantId * [Onebot] Added MessageStyle ability to onebot (Untested) * nya * abaaba * ababa * ababa ababa * trigger CI
- Loading branch information
Showing
19 changed files
with
297 additions
and
27 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,25 @@ | ||
namespace Lagrange.Core.Common.Entity; | ||
|
||
public class MessageStyle | ||
{ | ||
public ulong BubbleId { get; set; } | ||
|
||
public ulong PendantId { get; set; } | ||
|
||
public ushort FontId { get; set; } | ||
|
||
/// <summary> | ||
/// Font effect id, 2000 for super large font | ||
/// </summary> | ||
public uint FontEffectId { get; set; } | ||
|
||
/// <summary> | ||
/// Whether the "font grows and shrinks" effect is enabled | ||
/// </summary> | ||
public bool IsCsFontEffectEnabled { get; set; } | ||
|
||
/// <summary> | ||
/// Custom bubble sticker/text archive id | ||
/// </summary> | ||
public uint BubbleDiyTextId { get; set; } | ||
} |
32 changes: 32 additions & 0 deletions
32
Lagrange.Core/Internal/Packets/Message/Component/Extra/MessageStyleExtra.cs
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,32 @@ | ||
using ProtoBuf; | ||
|
||
namespace Lagrange.Core.Internal.Packets.Message.Component.Extra; | ||
|
||
[ProtoContract] | ||
internal class MessageStyleExtra | ||
{ | ||
/// <summary> | ||
/// If the user is an admin or group owner, this field value is 10315 | ||
/// </summary> | ||
[ProtoMember(4)] public int Field4 { get; set; } = 10315; | ||
[ProtoMember(15)] public ulong Font { get; set; } | ||
[ProtoMember(34)] public uint FontEffectId { get; set; } | ||
|
||
[ProtoMember(51)] public ulong VipType { get; set; } = 337; | ||
|
||
[ProtoMember(52)] public ulong VipLevel { get; set; } = 2; | ||
|
||
[ProtoMember(56)] public ulong VipNameplate { get; set; } | ||
|
||
[ProtoMember(65)] public GroupMemberLevelInfo? GroupMemberLevel { get; set; } | ||
|
||
[ProtoMember(81)] public ulong GroupHonorStyle { get; set; } | ||
|
||
[ProtoMember(107)] public uint MessageSequence { get; set; } | ||
|
||
[ProtoContract] | ||
internal class GroupMemberLevelInfo | ||
{ | ||
[ProtoMember(2)] public int Level { get; set; } | ||
} | ||
} |
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
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
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
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
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
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
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
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
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
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
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
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,31 @@ | ||
using System.Text.Json.Serialization; | ||
using Lagrange.Core.Common.Entity; | ||
|
||
namespace Lagrange.OneBot.Core.Entity; | ||
|
||
public class OnebotMessageStyle | ||
{ | ||
[JsonPropertyName("bubble_id")] public ulong BubbleId { get; set; } | ||
|
||
[JsonPropertyName("pendant_id")] public ulong PendantId { get; set; } | ||
|
||
[JsonPropertyName("font_id")] public ushort FontId { get; set; } | ||
|
||
[JsonPropertyName("font_effect_id")] public uint FontEffectId { get; set; } | ||
|
||
[JsonPropertyName("is_cs_font_effect_enabled")] public bool IsCsFontEffectEnabled { get; set; } | ||
|
||
[JsonPropertyName("bubble_diy_text_id")] public uint BubbleDiyTextId { get; set; } | ||
|
||
public OnebotMessageStyle() {} | ||
|
||
public OnebotMessageStyle(MessageStyle style) | ||
{ | ||
BubbleId = style.BubbleId; | ||
PendantId = style.PendantId; | ||
FontId = style.FontId; | ||
FontEffectId = style.FontEffectId; | ||
IsCsFontEffectEnabled = style.IsCsFontEffectEnabled; | ||
BubbleDiyTextId = style.BubbleDiyTextId; | ||
} | ||
} |
Oops, something went wrong.