/// <summary> /// Type=11 群文件上传事件<para/> /// 处理收到的群文件上传结果 /// </summary> /// <param name="sender">事件的触发对象</param> /// <param name="e">事件的附加参数</param> public void ReceiveGroupFileUpload(object sender, FileUploadMessageEventArgs e) { // 本子程序会在酷Q【线程】中被调用,请注意使用对象等需要初始化(CoInitialize,CoUninitialize)。 // 这里处理消息 // 关于文件信息, 触发事件时已经转换完毕, 请直接使用 e.Handled = false; // 关于返回说明, 请参见 "Event_FriendMessage.ReceiveFriendMessage" 方法 }
private static int EventGroupUpload(int subType, int sendTime, long fromGroup, long fromQQ, string file) { FileUploadMessageEventArgs args = new FileUploadMessageEventArgs(); args.SendTime = NativeConvert.FotmatUnixTime(sendTime.ToString()); args.FromGroup = fromGroup; args.FromQQ = fromQQ; args.File = Common.CqApi.GetFile(file); ReceiveFileUploadMessage(null, args); return((int)(args.Handled ? MessageHanding.Intercept : MessageHanding.Ignored)); //如果处理过就截断消息 }
/// <summary> /// Type=11 群文件上传事件<para/> /// 处理收到的群文件上传结果 /// </summary> /// <param name="sender">事件的触发对象</param> /// <param name="e">事件的附加参数</param> public void ReceiveGroupFileUpload(object sender, FileUploadMessageEventArgs e) { // 本子程序会在酷Q【线程】中被调用,请注意使用对象等需要初始化(CoInitialize,CoUninitialize)。 // 这里处理消息 // 关于文件信息, 触发事件时已经转换完毕, 请直接使用 e.Handled = LuaEnv.LuaEnv.RunLua( $"fromqq={e.FromQQ} " + $"fromgroup={e.FromGroup} " + $"fileName=[[{e.File.Name.Replace("]", "] ")}]] " + $"id={e.File.Id} " + $"size={e.File.Size}", "envent/ReceiveGroupFileUpload.lua"); //e.Handled = false; // 关于返回说明, 请参见 "Event_FriendMessage.ReceiveFriendMessage" 方法 }
/// <summary> /// Type=11 群文件上传事件<para/> /// 处理收到的群文件上传结果 /// </summary> /// <param name="sender">事件的触发对象</param> /// <param name="e">事件的附加参数</param> public void ReceiveGroupFileUpload(object sender, FileUploadMessageEventArgs e) { // 本子程序会在酷Q【线程】中被调用,请注意使用对象等需要初始化(CoInitialize,CoUninitialize)。 // 这里处理消息 // 关于文件信息, 触发事件时已经转换完毕, 请直接使用 e.Handled = LuaEnv.LuaEnv.RunLua( "", "envent/ReceiveGroupFileUpload.lua", new ArrayList { "fromqq", e.FromQQ, "fromgroup", e.FromGroup, "fileName", e.File.Name, "id", e.File.Id, "size", e.File.Size }); //e.Handled = false; // 关于返回说明, 请参见 "Event_FriendMessage.ReceiveFriendMessage" 方法 }