forked from LagrangeDev/LagrangeV2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBotGroupNudgeEventStruct.cs
More file actions
45 lines (38 loc) · 1.32 KB
/
Copy pathBotGroupNudgeEventStruct.cs
File metadata and controls
45 lines (38 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System.Runtime.InteropServices;
using System.Text;
using Lagrange.Core.Events.EventArgs;
using Lagrange.Core.NativeAPI.NativeModel.Common;
namespace Lagrange.Core.NativeAPI.NativeModel.Event
{
[StructLayout(LayoutKind.Sequential)]
public struct BotGroupNudgeEventStruct : IEventStruct
{
public BotGroupNudgeEventStruct() { }
public long GroupUin = 0;
public long OperatorUin = 0;
public ByteArrayNative Action = new();
public long TargetUin = 0;
public ByteArrayNative Suffix = new();
public static implicit operator BotGroupNudgeEvent(BotGroupNudgeEventStruct e)
{
return new BotGroupNudgeEvent(
e.GroupUin,
e.OperatorUin,
Encoding.UTF8.GetString(e.Action),
e.TargetUin,
Encoding.UTF8.GetString(e.Suffix)
);
}
public static implicit operator BotGroupNudgeEventStruct(BotGroupNudgeEvent e)
{
return new BotGroupNudgeEventStruct()
{
GroupUin = e.GroupUin,
OperatorUin = e.OperatorUin,
Action = Encoding.UTF8.GetBytes(e.Action),
TargetUin = e.TargetUin,
Suffix = Encoding.UTF8.GetBytes(e.Suffix)
};
}
}
}