Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ public struct ReverseEventCountStruct
public ReverseEventCountStruct() { }

public int BotCaptchaEventCount = 0;
public int BotFriendRequestEventCount = 0;
public int BotGroupInviteNotificationEventCount = 0;
public int BotGroupInviteSelfEventCount = 0;
public int BotGroupJoinNotificationEventCount = 0;
public int BotGroupMemberDecreaseEventCount = 0;
public int BotGroupNudgeEventCount = 0;
public int BotGroupReactionEventCount = 0;
public int BotLoginEventCount = 0;
public int BotLogEventCount = 0;
public int BotMessageEventCount = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,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)
};
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System.Runtime.InteropServices;
using Lagrange.Core.Events.EventArgs;

namespace Lagrange.Core.NativeAPI.NativeModel.Event
{
[StructLayout(LayoutKind.Sequential)]
public struct BotGroupInviteSelfEventStruct : IEventStruct
{
public BotGroupInviteSelfEventStruct() { }

public long InvitationSeq = 0;

public long InitiatorUin = 0;

public long GroupUin = 0;

//public static implicit operator BotGroupMemberDecreaseEvent(BotGroupMemberDecreaseEventStruct e)
//{
// return new BotGroupMemberDecreaseEvent(
// e.GroupUin, e.UserUin, e.OperatorUin
// );
//}

public static implicit operator BotGroupInviteSelfEventStruct(BotGroupInviteSelfEvent e)
{
return new BotGroupInviteSelfEventStruct()
{
InvitationSeq = e.InvitationSeq,
InitiatorUin = e.InitiatorUin,
GroupUin = e.GroupUin
};
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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 BotGroupReactionEventStruct : IEventStruct
{
public BotGroupReactionEventStruct() { }

public long TargetGroupUin = 0;

public ulong TargetSequence = 0;

public long OperatorUin = 0;

public bool IsAdd = false;

public ByteArrayNative Code = new();

public ulong CurrentCount = 0;

public static implicit operator BotGroupReactionEventStruct(BotGroupReactionEvent e)
{
return new BotGroupReactionEventStruct()
{
TargetGroupUin = e.TargetGroupUin,
TargetSequence = e.TargetSequence,
OperatorUin = e.OperatorUin,
IsAdd = e.IsAdd,
Code = Encoding.UTF8.GetBytes(e.Code),
CurrentCount = e.CurrentCount
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ public struct ReverseEventCountStruct
public ReverseEventCountStruct() { }

public int BotCaptchaEventCount = 0;
public int BotFriendRequestEventCount = 0;
public int BotGroupInviteNotificationEventCount = 0;
public int BotGroupInviteSelfEventCount = 0;
public int BotGroupJoinNotificationEventCount = 0;
public int BotGroupMemberDecreaseEventCount = 0;
public int BotGroupNudgeEventCount = 0;
public int BotGroupReactionEventCount = 0;
public int BotLoginEventCount = 0;
public int BotLogEventCount = 0;
public int BotMessageEventCount = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Lagrange.Core.Events.EventArgs;
using Lagrange.Core.NativeAPI.NativeModel;
using Lagrange.Core.NativeAPI.NativeModel.Event;
using Lagrange.Core.NativeAPI.ReverseEvent.Abstract;

namespace Lagrange.Core.NativeAPI.ReverseEvent
{
public class BotFriendRequestReverseEvent : ReverseEventBase
{
public override void RegisterEventHandler(BotContext context)
{
context.EventInvoker.RegisterEvent<BotFriendRequestEvent>((ctx, e) =>
{
Events.Add((BotFriendRequestEventStruct)e);
});
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Lagrange.Core.Events.EventArgs;
using Lagrange.Core.NativeAPI.NativeModel;
using Lagrange.Core.NativeAPI.NativeModel.Event;
using Lagrange.Core.NativeAPI.ReverseEvent.Abstract;

namespace Lagrange.Core.NativeAPI.ReverseEvent
{
public class BotGroupInviteSelfReverseEvent : ReverseEventBase
{
public override void RegisterEventHandler(BotContext context)
{
context.EventInvoker.RegisterEvent<BotGroupInviteSelfEvent>((ctx, e) =>
{
Events.Add((BotGroupInviteSelfEventStruct)e);
});
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Lagrange.Core.Events.EventArgs;
using Lagrange.Core.NativeAPI.NativeModel;
using Lagrange.Core.NativeAPI.NativeModel.Event;
using Lagrange.Core.NativeAPI.ReverseEvent.Abstract;

namespace Lagrange.Core.NativeAPI.ReverseEvent
{
public class BotGroupReactionReverseEvent : ReverseEventBase
{
public override void RegisterEventHandler(BotContext context)
{
context.EventInvoker.RegisterEvent<BotGroupReactionEvent>((ctx, e) =>
{
Events.Add((BotGroupReactionEventStruct)e);
});
}
}
}
Loading
Loading