예제 #1
0
        /// <summary>
        /// 发送群聊消息测试
        /// </summary>
        async void SendGroupMessageAsync()
        {
            if (!leijun.IsOnline())
            {
                logger.DebugFormat("{0} offline, quit!", leijun.AppAccount);
                return;
            }
            if (!linbin.IsOnline())
            {
                logger.DebugFormat("{0} offline, quit!", linbin.AppAccount);
                return;
            }
            long topicId = CreateNormalTopic(topicUrl, appAccount1, appAccount1 + "," + appAccount2);

            String packetId = await leijun.SendGroupMessageAsync(topicId, UTF8Encoding.Default.GetBytes("Hi,everybody!" + DateTime.Now.ToString("u")));

            logger.InfoFormat("SendGroupMessage, {0}-->{1}, PacketId:{2}", leijun.AppAccount, linbin.AppAccount, packetId);
            Thread.Sleep(100);
        }