public Task<ActionEvent> GetContact(ActionEventListener listener = null) { // 如果直接new一个Action并执行的话也可以,但是不能自动重试 return new WebWeChatActionFuture(Context, listener) .PushAction<GetContactAction>() .ExecuteAsync(); }
public Task<ActionEvent> Login(ActionEventListener listener = null) { return new WebWeChatActionFuture(Context, listener) .PushAction<GetUuidAction>() .PushAction<GetQRCodeAction>(async (sender, @event) => { if (@event.Type != ActionEventType.EvtOK) return; var verify = (Image)@event.Target; await Context.FireNotifyAsync(WeChatNotifyEvent.CreateEvent(WeChatNotifyEventType.QRCodeReady, verify)); }) .PushAction<WatiForLoginAction>(async (sender, @event) => { if (@event.Type != ActionEventType.EvtOK) return; var result = (WatiForLoginResult)@event.Target; switch (result) { case WatiForLoginResult.Success: await Context.FireNotifyAsync(WeChatNotifyEvent.CreateEvent(WeChatNotifyEventType.QRCodeSuccess)); break; case WatiForLoginResult.QRCodeInvalid: await Context.FireNotifyAsync(WeChatNotifyEvent.CreateEvent(WeChatNotifyEventType.QRCodeInvalid)); @event.Type = ActionEventType.EvtError; // �������������ִ�� break; case WatiForLoginResult.ScanCode: @event.Type = ActionEventType.EvtRepeat; break; } }) .PushAction<WebLoginAction>() .PushAction<WebwxInitAction>() .PushAction<StatusNotifyAction>() .PushAction<GetContactAction>(async (sender, @event) => { if (@event.Type != ActionEventType.EvtOK) return; await Context.FireNotifyAsync(WeChatNotifyEvent.CreateEvent(WeChatNotifyEventType.LoginSuccess)); }) .ExecuteAsync(); }
public Task <ActionEvent> Login(ActionEventListener listener = null) { return(GetModule <ILoginModule>().Login(listener)); }
protected WebQQInfoAction(IQQContext context, ActionEventListener listener = null) : base(context, listener) { }
/// <summary> /// 只传一个listener的重载 /// 当使用lambda表达式传递listener的时候会匹配到这个重载 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="listener"></param> /// <returns></returns> public WebWeChatActionFuture PushAction <T>(ActionEventListener listener) where T : WebWeChatAction { var action = ActionFactory.CreateAction <T>(listener); return((WebWeChatActionFuture)base.PushAction(action)); }
public WatiForLoginAction(IWeChatContext context, ActionEventListener listener = null) : base(context, listener) { }
public GetOnlineFriendsAction(IQQContext context, ActionEventListener listener = null) : base(context, listener) { }
public SendMsgAction(IWeChatContext context, MessageSent msg, ActionEventListener listener = null) : base(context, listener) { _msg = msg; }
public SyncCheckAction(IWeChatContext context, ActionEventListener listener = null) : base(context, listener) { }
public GetGroupNameListAction(IQQContext context, ActionEventListener listener = null) : base(context, listener) { }
public Task<ActionEvent> Login(ActionEventListener listener) { return new WebQQActionFuture(Context, listener) .PushAction<GetQRCodeAction>(async (sender, @event) => // 1.��ȡ��ά�� { if (@event.Type == ActionEventType.EvtOK) { var verify = (Image)@event.Target; await Context.FireNotifyAsync(QQNotifyEvent.CreateEvent(QQNotifyEventType.QRCodeReady, verify)); } }) .PushAction<CheckQRCodeAction>(async (sender, @event) => // 2.��ȡ��ά��ɨ��״̬ { if (@event.Type != ActionEventType.EvtOK) return; var args = (CheckQRCodeArgs)@event.Target; switch (args.Status) { case QRCodeStatus.OK: Session.CheckSigUrl = args.Msg; await Context.FireNotifyAsync(QQNotifyEvent.CreateEvent(QQNotifyEventType.QRCodeSuccess)); break; case QRCodeStatus.Valid: case QRCodeStatus.Auth: Logger.LogDebug($"��ά��״̬��{args.Status.GetDescription()}"); @event.Type = ActionEventType.EvtRepeat; await Task.Delay(3000); break; case QRCodeStatus.Invalid: await Context.FireNotifyAsync(QQNotifyEvent.CreateEvent(QQNotifyEventType.QRCodeInvalid, args.Msg)); break; } }) .PushAction<CheckSigAction>() .PushAction<GetVfwebqqAction>() .PushAction<ChannelLoginAction>(async (sender, @event) => { if (@event.Type != ActionEventType.EvtOK) return; await Context.FireNotifyAsync(QQNotifyEvent.CreateEvent(QQNotifyEventType.LoginSuccess)); }) .PushAction<GetFriendsAction>(async (sender, @event) => { if (@event.Type != ActionEventType.EvtOK) return; var obj = Store.FriendDic.FirstOrDefault().Value; if (obj == null) return; await new GetFriendLongNickAction(Context, obj).ExecuteAsyncAuto(); await new GetFriendQQNumberAction(Context, obj).ExecuteAsyncAuto(); await new GetFriendInfoAction(Context, obj).ExecuteAsyncAuto(); }) .PushAction<GetGroupNameListAction>(async (sender, @event) => { if (@event.Type != ActionEventType.EvtOK) return; var group = Store.GroupDic.FirstOrDefault().Value; if (group != null) { await new GetGroupInfoAction(Context, group).ExecuteAsyncAuto(); } }) .PushAction<GetDiscussionListAction>(async (sender, @event) => { if (@event.Type != ActionEventType.EvtOK) return; var dis = Store.DiscussionDic.FirstOrDefault().Value; if (dis != null) { await new GetDiscussionInfoAction(Context, dis).ExecuteAsyncAuto(); } }) .PushAction<GetSelfInfoAction>() .PushAction<GetOnlineFriendsAction>() .ExecuteAsync(); }
public Task<ActionEvent> SendMsg(MessageSent msg, ActionEventListener listener = null) { return new SendMsgAction(Context, msg) .ExecuteAsyncAuto(); }
public Task<ActionEvent> GetRobotReply(RobotType robotType, string input, ActionEventListener listener = null) { return new GetTuringRobotReplyAction(Context, input) .ExecuteAsyncAuto(); }
public GetSelfInfoAction(IQQContext context, ActionEventListener listener = null) : base(context, listener) { }
public GetTuringRobotReplyAction(IWeChatContext context, string input, ActionEventListener listener = null) : base(context, listener) { _input = input; _key = Config["TulingApiKey"]; }
public ChannelLoginAction(IQQContext context, ActionEventListener listener = null) : base(context, listener) { }
protected WebQQAction(IQQContext context, ActionEventListener listener = null) : base(context.GetSerivce<IHttpService>()) { _context = context; OnActionEvent += listener; }
public GetUuidAction(IWeChatContext context, ActionEventListener listener = null) : base(context, listener) { Session.Seq = Timestamp; }
public BatchGetContactAction(IWeChatContext context, ActionEventListener listener = null) : base(context, listener) { }
public GetFriendQQNumberAction(IQQContext context, QQFriend friend, ActionEventListener listener = null) : base(context, listener) { _friend = friend; }
public GetGroupInfoAction(IQQContext context, QQGroup group, ActionEventListener listener = null) : base(context, listener) { _group = group; }
public GetDiscussionListAction(IQQContext context, ActionEventListener listener = null) : base(context, listener) { }
public ActionFuture(ActionEventListener listener = null) { _outerListener = listener; }
public WebLoginAction(IWeChatContext context, ActionEventListener listener = null) : base(context, listener) { }
public Task <ActionEvent> GetGroupMember(ActionEventListener listener = null) { return(new WebWeChatActionFuture(Context, listener) .PushAction <BatchGetContactAction>() .ExecuteAsync()); }
public Task<ActionEvent> GetGroupMember(ActionEventListener listener = null) { return new WebWeChatActionFuture(Context, listener) .PushAction<BatchGetContactAction>() .ExecuteAsync(); }
public CheckQRCodeAction(IQQContext context, ActionEventListener listener = null) : base(context, listener) { }
public Task <ActionEvent> GetRobotReply(RobotType robotType, string input, ActionEventListener listener = null) { return(new GetTuringRobotReplyAction(Context, input) .ExecuteAsyncAuto()); }
public PollMsgAction(IQQContext context, ActionEventListener listener = null) : base(context, listener) { }
public GetQRCodeAction(IQQContext context, ActionEventListener listener = null) : base(context, listener) { }
public GetContactAction(IWeChatContext context, ActionEventListener listener = null) : base(context, listener) { }
public WebQQActionFuture(IQQContext context, ActionEventListener listener = null) : base(listener) { ActionFactory = context.GetSerivce <IQQActionFactory>(); }
public GetVfwebqqAction(IQQContext context, ActionEventListener listener = null) : base(context, listener) { }
protected WebQQAction(IQQContext context, ActionEventListener listener = null) : base(context.GetSerivce <IHttpService>()) { _context = context; OnActionEvent += listener; }
public WebQQActionFuture PushAction <T>(object obj, ActionEventListener listener) where T : WebQQAction { var action = ActionFactory.CreateAction <T>(obj, listener); return((WebQQActionFuture)base.PushAction(action)); }
public Task <ActionEvent> GetGroupMember(ActionEventListener listener = null) { return(GetModule <IContactModule>().GetGroupMember(listener)); }
public Task <ActionEvent> SendMsg(MessageSent msg, ActionEventListener listener = null) { return(GetModule <IChatModule>().SendMsg(msg, listener)); }
public Task <ActionEvent> GetRobotReply(RobotType robotType, string input, ActionEventListener listener = null) { return(GetModule <IChatModule>().GetRobotReply(robotType, input, listener)); }
public GetDiscussionInfoAction(IQQContext context, QQDiscussion discussion, ActionEventListener listener = null) : base(context, listener) { _discussion = discussion; }
public Task <ActionEvent> SendMsg(Message msg, ActionEventListener listener = null) { return(new SendMsgAction(Context, msg, listener).ExecuteAsyncAuto()); }
public Task <ActionEvent> GetRobotReply(RobotType robotType, string input, ActionEventListener listener = null) { throw new NotImplementedException(); // return new GetTuringRobotReplyAction(Context, input).ExecuteAsyncAuto(); }
public WebwxSyncAction(IWeChatContext context, ActionEventListener listener = null) : base(context, listener) { }
public StatusNotifyAction(IWeChatContext context, ActionEventListener listener = null) : base(context, listener) { }
public GetQRCodeAction(IWeChatContext context, ActionEventListener listener = null) : base(context, listener) { }