隐藏 React Web 聊天机器人框架中的发送框如何做?

huangapple go评论62阅读模式
英文:

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

&lt;ReactWebChat
  attachmentMiddleware={attachmentMiddleware}
  directLine={directLine}
  styleOptions={styleOptions}
  store={store}
/&gt;
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 &#39;botframework-webchat&#39;;

const styleOptions = {
  hideSendBox: true
};

function MyChatComponent() {
  return (
    &lt;ReactWebChat
      styleOptions={styleOptions}
      directLine={directLine}
      userID=&quot;YOUR_USER_ID&quot;
      username=&quot;YOUR_USERNAME&quot;
      locale=&quot;en-US&quot;
    /&gt;
  );
}

<!-- end snippet -->

huangapple
  • 本文由 发表于 2023年4月13日 21:48:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76006229.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定