Ejemplo n.º 1
0
        /// <summary>
        /// 自动获取B站动态
        /// </summary>
        /// <param name="cqApi">CQApi</param>
        public static async void BiliUpdateCheck(CQApi cqApi)
        {
            //读取配置文件
            Config config       = new Config(cqApi.GetLoginQQ().Id);
            Module moduleEnable = config.LoadedConfig.ModuleSwitch;
            List <GroupSubscription> Subscriptions = config.LoadedConfig.SubscriptionConfig.GroupsConfig;
            //数据库
            SubscriptionDBHelper dbHelper = new SubscriptionDBHelper(cqApi);

            //检查模块是否启用
            if (!moduleEnable.Bili_Subscription || !moduleEnable.PCR_Subscription)
            {
                return;
            }
            foreach (GroupSubscription subscription in Subscriptions)
            {
                //PCR动态订阅
                if (subscription.PCR_Subscription)
                {
                    await GetDynamic(cqApi, 353840826, subscription.GroupId, dbHelper);
                }
                //臭DD的订阅
                foreach (long biliUser in subscription.SubscriptionId)
                {
                    await GetDynamic(cqApi, biliUser, subscription.GroupId, dbHelper);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 初始化特殊关键词
        /// </summary>
        public static void SpecialKeywordsInit(CQApi cqApi)
        {
            Keywords.Add("查询排名", KeywordCmdType.PCRTools_GetGuildRank);
            Keywords.Add("来点切噜", KeywordCmdType.Cheru_Encode);
            Keywords.Add("切噜~", KeywordCmdType.Cheru_Decode);
            Keywords.Add("切噜~", KeywordCmdType.Cheru_Decode);

            Keywords.Add("echo", KeywordCmdType.Debug_Echo);
            Keywords.Add(CQApi.CQCode_At(cqApi.GetLoginQQ().Id).ToString(), KeywordCmdType.At_Bot);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 初始化特殊关键词
 /// </summary>
 public static void SpecialKeywordsInit(CQApi cqApi)
 {
     Keywords.Add("查询排名", KeywordCmdType.PCRTools_GetGuildRank);
     Keywords.Add(CQApi.CQCode_At(cqApi.GetLoginQQ().Id).ToString(), KeywordCmdType.At_Bot);
 }
Ejemplo n.º 4
0
        private readonly string DBPath;//数据库路径
        #endregion

        #region 构造函数
        public SubscriptionDBHelper(CQApi api)
        {
            DBPath = SugarUtils.GetDBPath(api.GetLoginQQ().Id.ToString());
        }