gpt4 book ai didi

node.js - 在 heroCard botframework (nodejs) 中提及用户

转载 作者:行者123 更新时间:2023-12-04 08:40:31 25 4
gpt4 key购买 nike

用户想要向团队 channel 返回消息。在卡片中,我想提到将消息发送回 channel 的用户。按照说明操作 on the 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];

最佳答案

Wajeed-MSFT正确地说,英雄卡不支持提及。
然而,它们支持 Text MessagesAdaptive cards这对我有用。

关于node.js - 在 heroCard botframework (nodejs) 中提及用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64589249/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com