示例#1
0
        /// <summary>
        /// 机器人签到功能
        /// </summary>
        /// <param name="qq"></param>
        /// <param name="group"></param>
        void CheckIn(QQMessage qqMessage)
        {
            int coins = Random.Next(Config.CheckInMinCoins, Config.CheckInMaxCoins + 1);

            switch (MySqlHelper.ExecuteScalar($"select checkin ({qqMessage.QQ}, {coins})"))
            {
            case 1:
                qqMessage.Reply("今日已签到");
                break;

            case 2:
            case 3:
                qqMessage.Reply($"签到成功,金币加{coins}");
                break;

            default:
                throw new NotImplementedException();
            }
        }
示例#2
0
 /// <summary>
 /// 当群成员离开本群
 /// </summary>
 /// <param name="e"></param>
 /// <returns></returns>
 public override QMEventHandlerTypes OnGroupMemberLeave(QMGroupMemberDecreaseEventArgs e)
 {
     QQMessage.Reply(e.FromQQ, e.FromGroup, "离开了本群:" + e.FromQQ);
     return(base.OnGroupMemberLeave(e));
 }
示例#3
0
 /// <summary>
 /// 群员修改了群名片
 /// </summary>
 /// <param name="e"></param>
 /// <returns></returns>
 public override QMEventHandlerTypes OnGroupMemberCardChange(QMGroupMemberCardChangeEventArgs e)
 {
     QQMessage.Reply(e.FromQQ, e.FromGroup, "修改了名片:" + e.NewCard);
     return(base.OnGroupMemberCardChange(e));
 }
示例#4
0
 /// <summary>
 /// 当新人进群提示输出
 /// </summary>
 /// <param name="e"></param>
 /// <returns></returns>
 public override QMEventHandlerTypes OnGroupMemberBeAllowAdd(QMGroupMemberIncreaseEventArgs e)
 {
     QQMessage.Reply(e.FromQQ, e.FromGroup, "欢迎新人进群:么么哒:");
     return(base.OnGroupMemberBeAllowAdd(e));
 }
示例#5
0
        /// <summary>
        /// 金币查询
        /// </summary>
        /// <param name="qq"></param>
        /// <param name="group"></param>
        void Coins(QQMessage qqMessage)
        {
            int coins = Convert.ToInt32(MySqlHelper.ExecuteScalar($"select coins from checkin where qq = {qqMessage.QQ}"));

            qqMessage.Reply($"你目前拥有{coins}枚金币");
        }