【问题标题】:Customise Microsoft web chat自定义 Microsoft 网络聊天
【发布时间】:2019-05-05 14:25:15
【问题描述】:
我正在尝试使用 React 项目自定义 Microsoft 网络聊天:
- npm install botframework-webchat@master
在之前的版本中我已经通过fork master 自定义了web UI,但是这时候我不想丢失master 的更新,这里是我关注的参考Microsoft Bot Webchat。
我正在尝试使用相应的图像编辑用户/机器人图标,我不需要下面显示的上传按钮
试图创建中间件,以及扩展实际组件的自定义组件,但没有运气,我不确定最新的大师是否可行。请指导我如何做。
【问题讨论】:
标签:
botframework
bots
web-chat
【解决方案1】:
终于搞定了样式:
import { createStyleSet } from 'botframework-webchat;
const styleSet = createStyleSet({});
styleSet.uploadButton = { ...styleSet.uploadButton,
display: 'none'
};
styleSet.avatar = {...styleSet.avatar,
backgroundImage: `url(${imageUrl})`
};
同时将发送属性返回给组件
botAvatarInitials= ' '
userAvatarInitials= ' '
styleSet={styleSet}`