英文:
How to hide send box in React Web chat Bot framework
问题
I am working on an application where I would like to hide "Send Box" and display only messages coming from the Bot. I tried the below code, but somehow this did not work. Can anyone help me here.
我的应用程序中,我想隐藏"发送框",只显示来自机器人的消息。我尝试了下面的代码,但不知何故没有起作用。有人可以帮我吗?
My react version is 18.2.0 and botframework-webchat version is ^4.15.7
我的React版本是18.2.0,botframework-webchat版本是^4.15.7
<ReactWebChat
attachmentMiddleware={attachmentMiddleware}
directLine={directLine}
styleOptions={styleOptions}
store={store}
/>
const styleOptions = {
hideSendBox: true
};
英文:
I am working on an application where I would like to hide "Send Box" and display only messages coming from the Bot. I tried the below code, but somehow this did not work. Can anyone help me here.
My react version is 18.2.0 and botframework-webchat version is ^4.15.7
<ReactWebChat
attachmentMiddleware={attachmentMiddleware}
directLine={directLine}
styleOptions={styleOptions}
store={store}
/>
const styleOptions = {
hideSendBox: true
};
答案1
得分: 0
以下是翻译好的部分:
导入 { ReactWebChat } 从 'botframework-webchat';
const styleOptions = {
hideSendBox: true
};
function MyChatComponent() {
return (
<ReactWebChat
styleOptions={styleOptions}
directLine={directLine}
userID="YOUR_USER_ID"
username="YOUR_USERNAME"
locale="en-US"
/>
);
}
请注意,这是提供的代码片段的翻译部分。
英文:
I attaching a snippet below let me know if this works for you.
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
import { ReactWebChat } from 'botframework-webchat';
const styleOptions = {
hideSendBox: true
};
function MyChatComponent() {
return (
<ReactWebChat
styleOptions={styleOptions}
directLine={directLine}
userID="YOUR_USER_ID"
username="YOUR_USERNAME"
locale="en-US"
/>
);
}
<!-- end snippet -->
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论