Skip to content

Commit 8d8deb4

Browse files
committed
[Milky] provide concise display tip text for recall & nudge
1 parent dad0014 commit 8d8deb4

4 files changed

Lines changed: 24 additions & 12 deletions

File tree

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
namespace Lagrange.Core.Events.EventArgs;
22

3-
public class BotGroupNudgeEvent(long groupUin, long operatorUin, string action, long targetUin, string suffix) : EventBase
3+
public class BotGroupNudgeEvent(long groupUin, long operatorUin, string action, string actionImgUrl, long targetUin, string suffix) : EventBase
44
{
55
public long GroupUin { get; } = groupUin;
66

77
public long OperatorUin { get; } = operatorUin;
88

99
public string Action { get; } = action;
1010

11+
public string ActionImageUrl { get; } = actionImgUrl;
12+
1113
public long TargetUin { get; } = targetUin;
1214

1315
public string Suffix { get; } = suffix;
1416

1517
public override string ToEventMessage()
1618
{
17-
return $"{nameof(BotGroupNudgeEvent)}: In Group {GroupUin}, {OperatorUin} {Action} {TargetUin} {Suffix}";
19+
return $"{nameof(BotGroupNudgeEvent)}: In Group {GroupUin}, {OperatorUin} {Action}({ActionImageUrl}) {TargetUin} {Suffix}";
1820
}
1921
}

Lagrange.Core/Internal/Logic/PushLogic.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ public async ValueTask Incoming(ProtocolEvent e)
204204
groupUin,
205205
long.Parse(@params["uin_str1"]),
206206
@params["action_str"],
207+
@params["action_img_url"],
207208
long.Parse(@params["uin_str2"]),
208209
@params["suffix_str"]
209210
));

Lagrange.Milky/Entity/Event/GroupNudgeEvent.cs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,23 @@ namespace Lagrange.Milky.Entity.Event;
44

55
public class GroupNudgeEvent(long time, long selfId, GroupNudgeEventData data) : EventBase<GroupNudgeEventData>(time, selfId, "group_nudge", data) { }
66

7-
public class GroupNudgeEventData(long groupID, long sender_id, long receiver_id)
7+
public class GroupNudgeEventData(long groupID, long senderId, long receiverId, string displayAction, string displaySuffix, string displayActionImgUrl)
88
{
99
[JsonPropertyName("group_id")]
1010
public long GroupID { get; } = groupID;
11-
11+
1212
[JsonPropertyName("sender_id")]
13-
public long SenderID { get; } = sender_id;
14-
13+
public long SenderID { get; } = senderId;
14+
1515
[JsonPropertyName("receiver_id")]
16-
public long ReceiverID { get; } = receiver_id;
17-
}
16+
public long ReceiverID { get; } = receiverId;
17+
18+
[JsonPropertyName("display_action")]
19+
public string DisplayAction = displayAction;
20+
21+
[JsonPropertyName("display_suffix")]
22+
public string DisplaySuffix { get; } = displaySuffix;
23+
24+
[JsonPropertyName("display_action_img_url")]
25+
public string DisplayActionImgUrl { get; } = displayActionImgUrl;
26+
}

Lagrange.Milky/Utility/EntityConvert.Event.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ public partial class EntityConvert
1717
_bot.BotUin,
1818
MessageBase(@event.Message)
1919
);
20-
20+
2121
public GroupNudgeEvent GroupNudgeEvent(LgrEventArgs.BotGroupNudgeEvent @event) => new(
2222
@event.EventTime.ToUnixTimeSeconds(),
2323
_bot.BotUin,
24-
new GroupNudgeEventData(@event.GroupUin, @event.OperatorUin, @event.TargetUin)
24+
new GroupNudgeEventData(@event.GroupUin, @event.OperatorUin, @event.TargetUin, @event.Action, @event.Suffix, @event.ActionImageUrl)
2525
);
26-
26+
2727
public GroupMemberDecreaseEvent GroupMemberDecreaseEvent(LgrEventArgs.BotGroupMemberDecreaseEvent @event) => new(
2828
@event.EventTime.ToUnixTimeSeconds(),
2929
_bot.BotUin,
@@ -33,7 +33,7 @@ public partial class EntityConvert
3333
@event.OperatorUin == 0 ? null : @event.OperatorUin
3434
)
3535
);
36-
36+
3737
public FriendRequestEvent FriendRequestEvent(LgrEventArgs.BotFriendRequestEvent @event) => new(
3838
@event.EventTime.ToUnixTimeSeconds(),
3939
_bot.BotUin,

0 commit comments

Comments
 (0)