示例#1
0
#pragma warning disable CS0618
        public static Attachment ToAttachment(this KeyboardCard keyboard)
        {
            return(new Attachment
            {
                ContentType = KeyboardCard.ContentType,
                Content = keyboard
            });
        }
示例#2
0
 /// <summary>
 /// Maps a <see cref="KeyboardCard"/> to a <see cref="FacebookMessage"/>
 /// </summary>
 /// <param name="keyboard"> The keyboard card.</param>
 public static FacebookMessage ToFacebookMessage(this KeyboardCard keyboard)
 {
     return(new FacebookMessage(text: keyboard.Text, quickReplies: keyboard.Buttons.Select(b => b.ToFacebookQuickReply()).ToList()));
 }
示例#3
0
 /// <summary>
 /// Maps a <see cref="KeyboardCard"/> to a <see cref="HeroCard"/>
 /// </summary>
 /// <param name="keyboard"> The keyboard card.</param>
 public static HeroCard ToHeroCard(this KeyboardCard keyboard)
 {
     return(new HeroCard(text: keyboard.Text, buttons: keyboard.Buttons));
 }