Example #1
0
        private static async void BotOnCallbackQueryReceived(object sender, CallbackQueryEventArgs callbackQueryEventArgs)
        {
            string TCMUri = callbackQueryEventArgs.CallbackQuery.Data;

            if (TCMUri != null)
            {
                var client = new SessionAwareCoreServiceClient("wsHttp_201603");
                client.ClientCredentials.Windows.ClientCredential = new NetworkCredential("srv-cmtask", "srv_tridion_cm", "global");
                var instruction = new UnPublishInstructionData()
                {
                    ResolveInstruction = new ResolveInstructionData()
                };
                var pt = client.UnPublish(new[] { TCMUri }, instruction, new[] { "purp1" }, null, new ReadOptions());
                await Bot.AnswerCallbackQueryAsync(callbackQueryEventArgs.CallbackQuery.Id, $"Sucessfully unpublished {callbackQueryEventArgs.CallbackQuery.Data}", cacheTime : 0);
            }
            else
            {
                await Bot.AnswerCallbackQueryAsync(callbackQueryEventArgs.CallbackQuery.Id, $"Nothing", cacheTime : 0);
            }
        }