Example #1
0
 public void SendPrivateMessage(long robotQQ, long fromGroup, long fromQQ, string message)
 {
     if (fromGroup == -1)
     {
         QMApi.SendFriendMessage(robotQQ, fromQQ, message);
     }
     else
     {
         QMApi.SendGroupTempMessage(robotQQ, fromGroup, fromQQ, message);
     }
 }
Example #2
0
        public override QMEventHandlerTypes OnReceiveFriendMessage(QMPrivateMessageEventArgs e)
        {
            if (MainSave.AppConfig.Object["接口"]["Private"].GetValueOrDefault(0) is 0)
            {
                return(QMEventHandlerTypes.Continue);
            }
            FunctionResult result = new FunctionResult();

            if (result.SendFlag)
            {
                foreach (var item in result.SendObject)
                {
                    QQ DestFriend = new QQ(item.SendID);
                    foreach (var sendMsg in item.MsgToSend)
                    {
                        QMApi.SendFriendMessage(e.RobotQQ, DestFriend, sendMsg);
                    }
                }
            }
            return(result.result);
        }