node.js - მომხმარებლის აღნიშნვა heroCard-ში botframework-ში (nodejs)


მომხმარებელი სურს, რომ დაბრუნდეს შეტყობინება Teams არხზე. ბარათში მსურს ვახსენო მომხმარებელი, რომელმაც უკან არხზე შეატყობინა შეტყობინება. Microsoft Docs-ზე მითითებული ინსტრუქციების გამოყენება ვერ იმუშავა. იმ TextEncoder-ის გამოყენებით, მომხმარებლის სახელი დაიკრიფებოდა და უბრალოდ, როგორც ნომრები (მაგ., 82,111,115,105,101,114,115,44,32,74,97,115,112,10,....) გაიგზავნებოდა უკან.

ქვემოთ მოცემული კონფიგურაცია აბრუნებს მომხმარებლის სახელს, მაგრამ არა როგორც მიმოხილვა, მხოლოდ ტექსტად. როგორ დავწერო ეს კოდი ისე, რომ მართლა შეეხოს მომხმარებელს?

მე ასევე ვცადე context.activity.from.name გამოყენება heroCard-ში, მაგრამ ეს არც მომხმარებელს ასახელებდა.

const mention = {
            mentioned: context.activity.from,
            text: `<at>${context.activity.from.name}</at>`,
            type: 'mention'
        } as Mention;

        const heroCard = CardFactory.heroCard(
            `Returned question by ${ mention.mentioned.name }`,
            `${ mention.mentioned.name } You can internally discuss the user request below. ` +
            'Once ready, one person can take ownership of the conversation with the user by pressing the button. ' +
            'The user\'s question: ' + teamsSupport.question,
            null,
            CardFactory.actions([
                {
                    title: 'Takeover conversation',
                    type: ActionTypes.MessageBack,
                    displayText: `I will take this conversation.`,
                    text: this.configService.get<string>('TakeoverConfirmation') + teamsSupport.sessionId,
                    value: ''
                },
                {
                    title: 'Show chat history',
                    type: ActionTypes.OpenUrl,
                    value: 'https://****/conversations/' + teamsSupport.sessionId
                }
            ])
        );

        const suggestedActions = MessageFactory.attachment(heroCard);
        suggestedActions.entities = [mention];

პასუხი #1

როგორც Wajeed-MSFT სწორად აღნიშნა, Mentions არ არის მხარდაჭერილი heroCards-ში.

თუმცა ისინი მხარდაჭერილი არიან ტექსტური შეტყობინებებით და ადაპტიური ბარათებით და ეს ჩემთვის მუშაობს.