예제 #1
0
        /// <summary>
        /// Get sender classification flags.
        /// </summary>
        public static SenderClassification GetSenderClassification(this BotRoutingContext context)
        {
            var result = SenderClassification.None;

            if (context.IsFromBot())
            {
                result |= SenderClassification.Bot;
            }
            if (context.IsFromRealPerson())
            {
                result |= SenderClassification.User;
            }
            if (context.IsFromAdmin())
            {
                result |= SenderClassification.Admin;
            }

            return(result);
        }
예제 #2
0
 /// <summary>
 /// Checks if the sender is a real person.
 /// </summary>
 public static bool IsFromRealPerson(this BotRoutingContext context)
 => !context.IsFromBot();