Beispiel #1
0
Datei: CQ.cs Projekt: zzzzzga/CQP
        /// <summary>
        /// 置群匿名设置。
        /// </summary>
        /// <param name="groupNumber">群号码。</param>
        /// <param name="allow">开启或关闭匿名功能。</param>
        public static void SetGroupAllowAnonymous(long groupNumber, bool allow)
        {
            CQLogger.GetInstance().AddLog(String.Format("[↑][禁言] 群:{0} QQ:{1}", groupNumber, allow ? "开启匿名" : "关闭匿名"));

            if (CQ.ProxyType == CQProxyType.UDP)
            {
                string content = String.Format("SetGroupAllowAnonymous|{0}|{1}", groupNumber, allow);
                CQUDPProxy.GetInstance().SendMessage(content);
            }
            else
            {
                CQAPI.SetGroupAnonymous(CQAPI.GetAuthCode(), groupNumber, allow ? 1 : 0);
            }
        }