Esempio n. 1
0
 public ReceivedMessage(CQApi api, long groupId, long qqId, int id, string msg, bool isRegex = false)
 {
     Type    = "group";
     Group   = new Group(api, groupId);
     QQ      = new QQ(api, qqId);
     Message = new QQMessage(api, id, msg, isRegex);
 }
Esempio n. 2
0
 /// <summary>
 /// 比较 <see cref="QQMessage"/> 中的内容和 string 是否相等
 /// </summary>
 /// <param name="qq">相比较的 <see cref="QQ"/> 对象</param>
 /// <param name="qqId">相比较的QQ号</param>
 /// <returns>如果相同返回 <code>true</code>, 不同返回 <code>false</code></returns>
 private static bool Equals(QQ qq, long qqId)
 {
     if (object.ReferenceEquals(qq, null) || qqId < 10000)
     {
         return(false);
     }
     return(qq.Id == qqId);
 }
Esempio n. 3
0
        /// <summary>
        /// 确定指定的对象是否等于当前对象
        /// </summary>
        /// <param name="obj">要与当前对象进行比较的对象</param>
        /// <returns>如果指定的对象等于当前对象,则为 <code>true</code>,否则为 <code>false</code></returns>
        public override bool Equals(object obj)
        {
            QQ qq = obj as QQ;

            if (qq != null)
            {
                return(this.Id == qq.Id);
            }
            return(base.Equals(obj));
        }
Esempio n. 4
0
 /// <summary>
 /// 移除群成员
 /// </summary>
 /// <param name="qq">目标QQ</param>
 /// <param name="notRequest">不再接收加群申请. 请慎用, 默认: False</param>
 /// <returns>修改成功返回 <code>true</code>, 失败返回 <code>false</code></returns>
 public bool RemoveGroupMember(QQ qq, bool notRequest = false)
 {
     return(this.CQApi.RemoveGroupMember(this, qq, notRequest));
 }
Esempio n. 5
0
 /// <summary>
 /// 解除群管理员
 /// </summary>
 /// <param name="qq">目标QQ</param>
 /// <returns>修改成功返回 <code>true</code>, 失败返回 <code>false</code></returns>
 public bool RemoveGroupManage(QQ qq)
 {
     return(this.CQApi.RemoveGroupManage(this, qq));
 }
Esempio n. 6
0
 /// <summary>
 /// 设置群管理员
 /// </summary>
 /// <param name="qq">目标QQ</param>
 /// <returns>修改成功返回 <code>true</code>, 失败返回 <code>false</code></returns>
 public bool SetGroupManage(QQ qq)
 {
     return(this.CQApi.SetGroupManage(this, qq));
 }
Esempio n. 7
0
 /// <summary>
 /// 设置群成员永久专属头衔
 /// </summary>
 /// <param name="qq">目标QQ</param>
 /// <param name="newTitle">新头衔</param>
 /// <returns>修改成功返回 <code>true</code>, 失败返回 <code>false</code></returns>
 public bool SetGroupMemberForeverExclusiveTitle(QQ qq, string newTitle)
 {
     return(this.CQApi.SetGroupMemberForeverExclusiveTitle(this, qq, newTitle));
 }
Esempio n. 8
0
 /// <summary>
 /// 设置群成员专属头衔, 并指定其过期的时间
 /// </summary>
 /// <param name="qq">目标QQ</param>
 /// <param name="newTitle">新头衔</param>
 /// <param name="time">过期时间 (范围: 1秒 ~ 30天)</param>
 /// <returns>修改成功返回 <code>true</code>, 失败返回 <code>false</code></returns>
 public bool SetGroupMemberExclusiveTitle(QQ qq, string newTitle, TimeSpan time)
 {
     return(this.CQApi.SetGroupMemberExclusiveTitle(this, qq, newTitle, time));
 }
Esempio n. 9
0
 /// <summary>
 /// 设置群成员名片
 /// </summary>
 /// <param name="qq">目标QQ</param>
 /// <param name="newName">新名称</param>
 /// <returns>修改成功返回 <code>true</code>, 失败返回 <code>false</code></returns>
 public bool SetGroupMemberVisitingCard(QQ qq, string newName)
 {
     return(this.CQApi.SetGroupMemberVisitingCard(this, qq, newName));
 }
Esempio n. 10
0
 /// <summary>
 /// 解除群成员禁言
 /// </summary>
 /// <param name="qq">目标QQ</param>
 /// <returns>禁言成功返回 <code>true</code>, 否则返回 <code>false</code></returns>
 public bool RemoveGroupMemberBanSpeak(QQ qq)
 {
     return(this.CQApi.RemoveGroupMemberBanSpeak(this, qq));
 }
Esempio n. 11
0
 /// <summary>
 /// 设置群成员禁言
 /// </summary>
 /// <param name="qq">目标QQ</param>
 /// <param name="time">禁言时长 (范围: 1秒 ~ 30天)</param>
 /// <returns>禁言成功返回 <code>true</code>, 否则返回 <code>false</code></returns>
 public bool SetGroupMemberBanSpeak(QQ qq, TimeSpan time)
 {
     return(this.CQApi.SetGroupMemberBanSpeak(this, qq, time));
 }
Esempio n. 12
0
 /// <summary>
 /// 获取群成员信息
 /// </summary>
 /// <param name="qq">目标帐号</param>
 /// <param name="notCache">不使用缓存, 默认为 <code>false</code>, 通常忽略本参数, 仅在必要时使用</param>
 /// <returns>获取成功返回 <see cref="GroupMemberInfo"/></returns>
 public GroupMemberInfo GetGroupMemberInfo(QQ qq, bool notCache = false)
 {
     return(this.CQApi.GetGroupMemberInfo(this, qq, notCache));
 }
Esempio n. 13
0
 public ReceivedMessage(CQApi api, long qqId, int id, string msg, bool isRegex = false)
 {
     Type    = "private";
     QQ      = new QQ(api, qqId);
     Message = new QQMessage(api, id, msg, isRegex);
 }