import * as React from 'react'
import WidgetBot, { API } from '@widgetbot/react-embed'
class App extends React.Component {
api: API
onAPI(api: API) {
this.api = api
api.on('signIn', user => {
console.log(`Signed in as ${user.name}`, user)
})
}
handleClick() {
this.api.emit('sendMessage', `Hello world! from \`@widgetbot/react-embed\``)
}
render() {
return (
<div>
<button onClick={this.handleClick.bind(this)}>
{`Send "Hello world"`}
</button>
<WidgetBot
server="299881420891881473"
channel="355719584830980096"
onAPI={this.onAPI.bind(this)}
/>
</div>
)
}
}
export default App
-
-
Notifications
You must be signed in to change notification settings - Fork 6
React iframe wrapper for WidgetBot
License
widgetbot-io/react-embed
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
React iframe wrapper for WidgetBot
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published