Beispiel #1
0
            public async Task <ChatMessage> ThinkAndReply(ServerData message)
            {
                foreach (var sub in bot.Subscribers)
                {
                    //Current account friends info
                }
                ChatMessage responseMsg;
                var         msgText = message.Content.ToStringUtf8();
                var         msg     = MsgBuilder.Parse(message);

                if (msg.IsPlainText)
                {
                    if (msg.Text == "image")
                    {
                        //Send Image File
                        responseMsg = MsgBuilder.BuildImageMessage("a.png", "image/png", 47, 48, "iVBORw0KGgoAAAANSUhEUgAAAC8AAAAwCAYAAACBpyPiAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH2wUSFzYAFqhyqAAAENNJREFUaN7FmlusncdVx39rZr69zz7HPuc4tpM4iR3bca4UkaZqi1p6L7QIVaBKwAM3lSJFBcQDT/CMhIAnHhCoEi9cXnigqqCINq2aXigladOE1tSO4zgX2/H9+Fz3d5mZtXiY2fuchPIK+2j8zf72d/nPmv9a819rLABPP/UxFpdWWFrZj9PRcQn+E843v+bFPy7ONd43OB9Kcx7npBy9w7kGJx5xDhFfmnOoes6/+iCnjr+EcxlTxSyXpopaRjWiWVHNqFo55oTmRM4RU43Z8gua499Zyv+sbnh1Z2OL6c4GH/qZLyHUz5O/Db/75G990HL+g2z5Q6p94wRx3uGDL805nHO4IKXvS/POIU5w4hBxiAgpC1//5n184H2XCN4wM8wUNcXUyKoFeNbST4Zq6eeUySmX3w1zbhy9+KfF+z/5i8/+9dc++5cFs/+dJx/ji1/4ZU6dePijKbZ/3nXb7xn6Ha+qAgYYgoEphoLVhoIlqKDMEqYR04TlREyZl1+ecOzoGmJDtfJAzqmCTmga0JzJKZVjTuisnxI5Z2KMMvRTn9JwyjS/452PP/HSH//RBy7cvrWOPPutX6Rt80PjMX819O2H1RLeeVzwhODxwc2t7L3DecF7KTPgBKlH50BEEBFASNnx1a/dw4c/+AbBKzCzvqEKqlboo9Xi2dBs5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Z2U6OkhlaWdodAA2MLuNbZ0AAAAWdEVYdFRodW1iOjpJbWFnZTo6V2lkdGgANTkR00Z3AAAAGXRFWHRUaHVtYjo6TWltZXR5cGUAaW1hZ2UvcG5nP7JWTgAAABd0RVh0VGh1bWI6Ok1UaW1lADEzMDU3MzQwNDCrCw2wAAAAEXRFWHRUaHVtYjo6U2l6ZQA1OTQzQjpo3pUAAABgdEVYdFRodW1iOjpVUkkAZmlsZTovLy9ob21lL3d3d3Jvb3QvbmV3c2l0ZS93d3cuZWFzeWljb24ubmV0L2Nkbi1pbWcuZWFzeWljb24uY24vc3JjLzUwOTIvNTA5Mjg0LnBuZ91LspIAAAAASUVORK5CYII=", "this is a image by chatbot");
                    }
                    else if (msg.Text == "file")
                    {
                        //Send file
                        responseMsg = MsgBuilder.BuildFileMessage("a.txt", "text/plain", "ZHNmZHMKZmRzZmRzZnNkZgpm5Y+N5YCS5piv56a75byA5oi/6Ze055qE5LiK6K++5LqGCg==", "this is a file by chatbot");
                    }
                    else if (msg.Text == "more")
                    {
                        MsgBuilder builder = new MsgBuilder();
                        //add text with bold
                        builder.AppendText("Hi,this is bold\n", isBold: true);
                        //add text with italic
                        builder.AppendText("Hi,this is italic\n", isItalic: true);
                        //add text with deleted
                        builder.AppendText("Hi,this is deleted\n", isDeleted: true);

                        //add text with code style
                        builder.AppendText("int a=100;\nint b=a*100-90;\n", isCode: true);
                        //add link
                        builder.AppendText("https://google.com\n", isLink: true);
                        //add domain
                        builder.AppendText("baidu.com\n", isLink: true);
                        //add mention message
                        builder.AppendText("@tinode\n", isMention: true);
                        //add hashtags
                        builder.AppendText("#Tinode\n", isHashTag: true);
                        builder.AppendText("\n\nnext is image\n");
                        //add image message
                        builder.AppendImage("a.png", "image/png", 0, 0, "iVBORw0KGgoAAAANSUhEUgAAAC8AAAAwCAYAAACBpyPiAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAA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IAAAAASUVORK5CYII=");
                        builder.AppendText("\n\nnext is file\n");
                        //add file message
                        builder.AppendFile("a.txt", "text/plain", "ZHNmZHMKZmRzZmRzZnNkZgpm5Y+N5YCS5piv56a75byA5oi/6Ze055qE5LiK6K++5LqGCg==");
                        responseMsg = builder.Message;
                    }
                    else if (msg.Text == "attach")
                    {
                        //upload a test file as attachment
                        var uploadInfo = await bot.Upload("./libgrpc_csharp_ext.x64.so");

                        if (uploadInfo != null)
                        {
                            responseMsg = MsgBuilder.BuildAttachmentMessage(uploadInfo, "This is a larget attachment file");
                        }
                        else
                        {
                            responseMsg = MsgBuilder.BuildTextMessage("I try to send you a larget attach file, but I am sorry I failed...");
                        }
                    }
                    else if (msg.Text == "form")
                    {
                        //send a form with button
                        MsgBuilder builder = new MsgBuilder();
                        builder.AppendText("What's your gender?", isBold: true, isForm: true);
                        builder.AppendText("Male", isButton: true, buttonDataName: "male", buttonDataVal: "user click male");
                        builder.AppendText("Female", isButton: true, buttonDataName: "female", buttonDataVal: "user click female");
                        builder.AppendText("Not Sure", isButton: true, buttonDataName: "NA", buttonDataVal: "user click NA");
                        responseMsg = builder.Message;
                    }
                    else
                    {
                        responseMsg = msg;
                    }
                }
                else
                {
                    responseMsg = msg;
                    //Extract more information
                    var mentions = msg.GetMentions();
                    foreach (var m in mentions)
                    {
                        Console.WriteLine($"Mentions:{m.Val}");
                    }

                    var images = msg.GetImages();
                    foreach (var image in images)
                    {
                        Console.WriteLine($"Image:Name={image.Name} Mime={image.Mime}");
                    }

                    var hashTags = msg.GetHashTags();
                    foreach (var hash in hashTags)
                    {
                        Console.WriteLine($"HashTags:{hash.Val}");
                    }

                    var links = msg.GetLinks();
                    foreach (var link in links)
                    {
                        Console.WriteLine($"Links:{link.Url}");
                    }

                    var files = msg.GetGenericAttachment();
                    foreach (var f in files)
                    {
                        Console.WriteLine($"Image:Name={f.Name} Mime={f.Mime}");
                    }
                }
                return(responseMsg);
            }