forked from LagrangeDev/LagrangeV2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBotFriendRequestEventStruct.cs
More file actions
40 lines (33 loc) · 1.25 KB
/
Copy pathBotFriendRequestEventStruct.cs
File metadata and controls
40 lines (33 loc) · 1.25 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
using System.Runtime.InteropServices;
using System.Text;
using Lagrange.Core.Common.Entity;
using Lagrange.Core.Events.EventArgs;
using Lagrange.Core.NativeAPI.NativeModel.Common;
namespace Lagrange.Core.NativeAPI.NativeModel.Event
{
[StructLayout(LayoutKind.Sequential)]
public struct BotFriendRequestEventStruct : IEventStruct
{
public BotFriendRequestEventStruct() { }
public ByteArrayNative InitiatorUid = new();
public long InitiatorUin = 0;
public ByteArrayNative Message = new();
public ByteArrayNative Source = new();
//public static implicit operator BotGroupMemberDecreaseEvent(BotGroupMemberDecreaseEventStruct e)
//{
// return new BotGroupMemberDecreaseEvent(
// e.GroupUin, e.UserUin, e.OperatorUin
// );
//}
public static implicit operator BotFriendRequestEventStruct(BotFriendRequestEvent e)
{
return new BotFriendRequestEventStruct()
{
InitiatorUid = Encoding.UTF8.GetBytes(e.InitiatorUid),
InitiatorUin = e.InitiatorUin,
Message = Encoding.UTF8.GetBytes(e.Message),
Source = Encoding.UTF8.GetBytes(e.Source)
};
}
}
}