c# - Herocard not displaying more than 3 buttons in skype Microsoft bot framework -


i've added 6 buttons in hero card , tried display them. works fine in teams , emulator doesn't work on skype. displays 3 buttons.

 private list<cardaction> getcardbutton(list<string> opts)     {         list<cardaction> cardbuttons = new list<cardaction>();         int = 1;         foreach(string opt in opts)         {             cardaction plbutton = new cardaction()             {                 title = opt,                 type = "postback",                 text = i.tostring(),                 value = i.tostring()             };             cardbuttons.add(plbutton);             i++;         }          return cardbuttons;      }  //passing list of strings.  list<cardaction> cardbuttons = getcardbutton(cardopts);          herocard plcard = new herocard()         {             title = "try here",             text = "with:",             buttons = cardbuttons          };         plattachment = plcard.toattachment(); 

but in skype see first 3 buttons. there way make card scrollable or reduce button size?

as shown in previous answer each channel has limitations on can displayed, number of buttons, length of text, etc. seems running limitation. 1 thing can if there more 3 buttons display card , present them in list or carousel.

here hacked code example:

using microsoft.bot.builder.dialogs; using microsoft.bot.connector; using system; using system.collections.generic; using system.linq; using system.threading.tasks;  namespace bot_application13.dialogs {     [serializable]     public class rootdialog : idialog<object>     {          public task startasync(idialogcontext context)         {             context.wait(messagereceivedasync);              return task.completedtask;         }          private async task messagereceivedasync(idialogcontext context, iawaitable<object> result)         {             list<attachment> cards = new list<attachment>();             list<cardaction> buttons = new list<cardaction>();             (int = 0; < 10; i++)             {                 cardaction ca = new cardaction()                 {                     title = i.tostring(),                     type = "postback",                     text = i.tostring(),                     value = i.tostring()                 };                 buttons.add(ca);             }              var reply = context.makemessage();             getcardsattachments(buttons, cards);             //reply.attachmentlayout = attachmentlayouttypes.list;             //or             reply.attachmentlayout = attachmentlayouttypes.carousel;             reply.attachments = cards;              await context.postasync(reply);              context.wait(this.messagereceivedasync);         }          private attachment getherocard(list<cardaction> buttons)         {             var herocard = new herocard();             //herocard.title = "title";             herocard.buttons = buttons;             return herocard.toattachment();           }          private void getcardsattachments(list<cardaction> buttons, list<attachment> cards)         {             if (buttons.count <= 3)             {                 cards.add(getherocard(buttons));             }             else             {                 var temp = new list<cardaction>();                 (int = 0; < buttons.count; i++)                 {                     if (i % 3 != 0)                     {                         temp.add(buttons.elementat(i));                     }                     else                     {                         if (i != 0)                         {                             cards.add(getherocard(temp));                         }                          temp = new list<cardaction>();                         temp.add(buttons.elementat(i));                     }                  }                 cards.add(getherocard(temp));             }         }     } } 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -