/// <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(); } }
/// <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)); }
/// <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)); }
/// <summary> /// 当新人进群提示输出 /// </summary> /// <param name="e"></param> /// <returns></returns> public override QMEventHandlerTypes OnGroupMemberBeAllowAdd(QMGroupMemberIncreaseEventArgs e) { QQMessage.Reply(e.FromQQ, e.FromGroup, "欢迎新人进群:么么哒:"); return(base.OnGroupMemberBeAllowAdd(e)); }
/// <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}枚金币"); }