Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yusukeiwaki/azurebot-playground
https://github.com/yusukeiwaki/azurebot-playground
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/yusukeiwaki/azurebot-playground
- Owner: YusukeIwaki
- Created: 2023-03-24T15:29:30.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-24T15:29:43.000Z (almost 2 years ago)
- Last Synced: 2024-10-18T08:34:12.815Z (3 months ago)
- Language: Ruby
- Size: 20.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### DEMO
```ruby
post '/webhook' do
# Handle a new message...
if params['type'] == 'message'
client = BotConnectorClient.new(
service_url: params['serviceUrl'],
conversation_id: params['conversation']['id'],
from_id: params['recipient']['id'],
)
activity_id = params['id']Thread.new do
# Reply immediately
id = client.create_message(activity_id: activity_id, text: 'Processing...')# Do something...
sleep 1# update the reply
client.update_message(activity_id: id, text: 'Result is ...')# And do something...
sleep 1# update the reply
client.update_message(activity_id: id, text: 'Result is Something')
end
end'OK'
end
```![image](image.gif)
### Development
Prepare Azure bot, and set the enviroment variables as below.
```
export TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export CLIENT_SECRET=x.XXX-xXXXxxXXXXXXXxxxxXX-XXxxxXXXXXXX
```