/// <summary> /// 初始化Get轮循 /// </summary> /// <param name="robot"></param> public GetCycle(ApiPluginClass api) { ApiPlugin = api; Thread th = new Thread(new ThreadStart(CycleBody)); th.Start(); Echo("Get循环模式启动成功!"); }
/// <summary> /// 对象初始化构造函数 /// </summary> /// <param name="api"></param> public BotEventHandle(ApiPluginClass api) { // 保存API对象 ApiPlugin = api; // 获取自身方法列表 MemberInfo[] methods = this.GetType().GetMethods(bindingFlag); // 整理符合规则的方法名 foreach (MemberInfo MethodItem in methods) { // Action_ 开头的方法 if (MethodItem.Name.Length > 8 && MethodItem.Name.Substring(0, 7) == "Action_") { ActionList.Add(MethodItem.Name); } // 获取 重定向的方法 else if (MethodItem.Name.Length > 12 && MethodItem.Name.Substring(0, 11) == "get_Action_") { ActionList.Add(MethodItem.Name.Substring(4)); } } }