-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathReceiver.cs
30 lines (26 loc) · 884 Bytes
/
Receiver.cs
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
using EleCho.GoCqHttpSdk;
using EleCho.GoCqHttpSdk.Message;
using EleCho.GoCqHttpSdk.Post;
using MiraiGoC;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MiraiGoC
{
class Receiver : CqPostPlugin
{
public override async Task OnGroupMessageAsync(CqGroupMessagePostContext context)
{
if (context.Session is not ICqActionSession actionSession)
return;
string GroupID = context.GroupId.ToString();
string SenderID = context.Sender.UserId.ToString();
string SenderName = context.Sender.Nickname;
string Message = context.RawMessage;
//var _msg = "["+GroupID+"] "+SenderName+"("+SenderID+") > "+Message;
Program.Logger.LogInfo($"群消息/{GroupID}: {Message}");
}
}
}