microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.47k stars 2.44k forks source link

[Skype] Truncated text in Hero Cards? #3713

Closed ofarukcaki closed 6 years ago

ofarukcaki commented 6 years ago

Bot Info

Issue Description

I created my app, I have a hero card inside my chatbot and it just works fine in emulator. But in other platforms my bots are truncating my text inside cards. Here is a screenshot : https://i.hizliresim.com/ROgLrZ.png roglrz

In the Emulator it is just fine: https://i.hizliresim.com/DyOVOZ.png dyovoz

Code Example

msg.attachments([
                    new builder.HeroCard(session)
                        .title(wol.Name)
                        .subtitle("Domain: "+wol.Domain)
                        .text("Breach Date: "+wol.BreachDate+"\n\n"+"\n\n"+
                        "Pwned Accounts: "+wol.PwnCount.toLocaleString()+
                        "\n\n——————\n\nThis breach contains:\n\n"+
                        wol.DataClasses.join("\n\n")),

                    new builder.HeroCard(session)
                        .title("About "+wol.Name+" Data Breach")                        
                        .text(striptags(wol.Description)),

                    new builder.HeroCard(session)
                        .subtitle("Other Informations:")                        
                        .text("Is Verified: "+otherI.verified+
                        "\n\nIs Sensitive: "+otherI.sens+
                        "\n\nSpam List: "+otherI.spam+
                        "\n\nIs Retired: "+otherI.retired+
                        "\n\nIs Fabricated: "+otherI.fabricated
                    )          
                ]);
                session.send(msg).endDialog();

Expected Behavior

Text inside the cards should be fully viewable

How can I fix my this issue?

ofarukcaki commented 6 years ago

Also my full codes are in here https://github.com/OFarukCaki/deneme

nwhitmont commented 6 years ago

@OFarukCaki Think of this as a design problem rather than a HeroCard problem.

You're not really using any of the features of the HeroCard template, like buttons, images, and card actions, so why do you need the HeroCard at all?

If you are only sending text, use normal messages instead of multiple HeroCards packed into a carousel layout.

Example:

let messageWithText = {
    type: "message",
    text: "**Message Title**\n\nLarge amount of text goes here..."
}
session.send(messageWithText);
ofarukcaki commented 6 years ago

@nwhitmont Thanks for your comment. I'm gonna try it now

ofarukcaki commented 6 years ago

@nwhitmont, How can I add more than 1 normal messages in carousel format, I can't find any documentation and I can't figure out

`var msg = new builder.Message(session); msg.attachmentLayout(builder.AttachmentLayout.carousel) msg.attachments([

                ......

            ]);`

How can I place my items inside that code block?

nwhitmont commented 6 years ago

@OFarukCaki You can only have cards or images in a carousel layout, it is not intended for use with text-only messages.

You can put attachment objects inside the array of attachments like this:

msg.attachments([ 
    {
        contentType: 'image/png',
        contentUrl: 'https://example.com/img/your_image.png',
        name: 'example image attachment'
    },
   {
        contentType: 'image/png',
        contentUrl: 'https://example.com/img/your_image.png',
        name: 'example image attachment'
    }
])
nwhitmont commented 6 years ago

reopen if you still have questions