Beispiel #1
0
        protected virtual async Task OnFacebookStandby(ITurnContext turnContext, FacebookStandby facebookStandby, CancellationToken cancellationToken)
        {
            _logger.LogInformation("PrimaryBot - Standby message received.");

            var text = facebookStandby?.Message?.Text;

            if (text?.Equals(OPTION_TAKE_THREAD_CONTROL, StringComparison.InvariantCultureIgnoreCase) == true)
            {
                await FacebookThreadControlHelper.TakeThreadControlAsync(_configuration["FacebookPageToken"], facebookStandby.Sender.Id, text);
            }
        }
        protected virtual async Task OnFacebookStandby(ITurnContext turnContext, FacebookStandby facebookStandby, CancellationToken cancellationToken)
        {
            _logger.LogInformation("SecondaryBot - Standby message received.");

            var text = facebookStandby?.Message?.Text;

            if (text?.Equals(OPTION_REQUEST_THREAD_CONTROL, StringComparison.InvariantCultureIgnoreCase) == true)
            {
                await FacebookThreadControlHelper.RequestThreadControlAsync(_configuration["FacebookPageToken"], facebookStandby.Sender.Id, "give me control");
            }
            else if (text?.Equals(OPTION_REQUEST_THREAD_CONTROL_NICELY, StringComparison.InvariantCultureIgnoreCase) == true)
            {
                await FacebookThreadControlHelper.RequestThreadControlAsync(_configuration["FacebookPageToken"], facebookStandby.Sender.Id, "please");
            }
        }
        protected virtual async Task OnFacebookStandby(ITurnContext turnContext, FacebookStandby facebookStandby, CancellationToken cancellationToken)
        {
            Logger.LogInformation("Standby message received.");

            // TODO: Your echo event handling logic here...
        }