API for development the Skype chat-bot
Project description
Python Skype Bot API for developing bots.
More instructions you can find on GitHub: https://github.com/denissa4/skype_chatbot
=====================================================================================
For start using import skype_chatbot package:
import skype_chatbot
=====================================================================================
Write you app ID and secret key:
app_id = "example_app_id"
app_secret = "example_app_secret"
=====================================================================================
Create object in source file:
bot = skype_chatbot.SkypeBot(app_id, app_secret)
=====================================================================================
Now you can use base methods:
send_message
send_media
create_animation_card
create_card_attachment
create_card_image
create_buttons
send_card
create_card_adaptive
create_item_for_adaptive_card
create_action_for_adaptive_card
=====================================================================================
Send message:
send_message(bot_id, bot_name, recipient, service, sender, text, text_format)
bot_id - skype bot id, you can get it from request data['recipient']['id'].
bot_name - skype bot name, you can get it from request data['recipient']['name'].
recipient - user, to whom you are sending the message. You can get it from request data['from'].
service - service url, you can get it from request data['serviceUrl'].
sender - conversation id, you can get it from request data['conversation']['id'].
text - text what you want to send recipient. Must be a string.
text_format - supported values: "plain", "markdown", or "xml" (default: "markdown").
=====================================================================================
Send media files:
send_media(bot_id, bot_name, recipient, service, sender, message_type, url, attachment_name)
bot_id - skype bot id, you can get it from request data['recipient']['id'].
bot_name - skype bot name, you can get it from request data['recipient']['name'].
recipient - user, to whom you are sending the message. You can get it from request data['from'].
service - service url, you can get it from request data['serviceUrl'].
sender - conversation id, you can get it from request data['conversation']['id'].
message_type - type of your media file, e.g. "image/png".
url - open url for your media file.
attachment_name - name, which is displayed to recipient.
=====================================================================================
Create card that can play animated GIFs or short videos:
create_animation_card(card_type, url, images, title, subtitle, text, buttons, autoloop, autostart, shareable)
card_type - type of card attachment ("hero", "thumbnail", "receipt").
url - open url for your animation file.
images - list of images, in card attachment (to create image use method create_card_image). Must be a list.
title - title for your card. Must be a string.
subtitle - subtitle for your card. Must be a string.
text - text for your card. Must be a string.
buttons - list of buttons, in card attachment (to create button use method create_buttons). Must be a list.
autoloop - default: True.
autostart - default: True.
shareable - default: True.
=====================================================================================
Create card attachment("hero", "thumbnail", "receipt"):
create_card_attachment(card_type, title, subtitle, text, images, buttons)
card_type - type of card attachment ("hero", "thumbnail", "receipt").
title - title for your card. Must be a string.
subtitle - subtitle for your card. Must be a string.
text - text for your card. Must be a string.
images - list of images, in card attachment (to create image use method create_card_image). Must be a list.
buttons - list of buttons, in card attachment (to create button use method create_buttons). Must be a list.
=====================================================================================
Create image for card:
create_card_image(url, alt)
url - open url for your image.
alt - alternative text for image.
=====================================================================================
Create button(actions) for card:
create_button(button_type, title, value)
button_type - type of your button(e.g. "openUrl", "postBack").
title - name of button.
value - value of button(e.g. if button_type="openUrl", value="example.com").
=====================================================================================
Send card attachment to recipient:
send_card(bot_id, bot_name, recipient, reply_to_id, service, sender, message_type, card_attachment, text)
bot_id - skype bot id, you can get it from request data['recipient']['id'].
bot_name - skype bot name, you can get it from request data['recipient']['name'].
reply_to_id - the message id you are replying to, you can get it from request data['id'].
recipient - user, to whom you are sending the message. You can get it from request data['from'].
service - service url, you can get it from request data['serviceUrl'].
sender - conversation id, you can get it from request data['conversation']['id'].
message_type - if you send more than one card, choose display way("carousel" or "list").
card_attachment - list of cards, in message (to create cards use method create_card_attachment). Must be a list.
text - text of your message.
=====================================================================================
More instructions you can find on GitHub: https://github.com/denissa4/skype_chatbot
=====================================================================================
For start using import skype_chatbot package:
import skype_chatbot
=====================================================================================
Write you app ID and secret key:
app_id = "example_app_id"
app_secret = "example_app_secret"
=====================================================================================
Create object in source file:
bot = skype_chatbot.SkypeBot(app_id, app_secret)
=====================================================================================
Now you can use base methods:
send_message
send_media
create_animation_card
create_card_attachment
create_card_image
create_buttons
send_card
create_card_adaptive
create_item_for_adaptive_card
create_action_for_adaptive_card
=====================================================================================
Send message:
send_message(bot_id, bot_name, recipient, service, sender, text, text_format)
bot_id - skype bot id, you can get it from request data['recipient']['id'].
bot_name - skype bot name, you can get it from request data['recipient']['name'].
recipient - user, to whom you are sending the message. You can get it from request data['from'].
service - service url, you can get it from request data['serviceUrl'].
sender - conversation id, you can get it from request data['conversation']['id'].
text - text what you want to send recipient. Must be a string.
text_format - supported values: "plain", "markdown", or "xml" (default: "markdown").
=====================================================================================
Send media files:
send_media(bot_id, bot_name, recipient, service, sender, message_type, url, attachment_name)
bot_id - skype bot id, you can get it from request data['recipient']['id'].
bot_name - skype bot name, you can get it from request data['recipient']['name'].
recipient - user, to whom you are sending the message. You can get it from request data['from'].
service - service url, you can get it from request data['serviceUrl'].
sender - conversation id, you can get it from request data['conversation']['id'].
message_type - type of your media file, e.g. "image/png".
url - open url for your media file.
attachment_name - name, which is displayed to recipient.
=====================================================================================
Create card that can play animated GIFs or short videos:
create_animation_card(card_type, url, images, title, subtitle, text, buttons, autoloop, autostart, shareable)
card_type - type of card attachment ("hero", "thumbnail", "receipt").
url - open url for your animation file.
images - list of images, in card attachment (to create image use method create_card_image). Must be a list.
title - title for your card. Must be a string.
subtitle - subtitle for your card. Must be a string.
text - text for your card. Must be a string.
buttons - list of buttons, in card attachment (to create button use method create_buttons). Must be a list.
autoloop - default: True.
autostart - default: True.
shareable - default: True.
=====================================================================================
Create card attachment("hero", "thumbnail", "receipt"):
create_card_attachment(card_type, title, subtitle, text, images, buttons)
card_type - type of card attachment ("hero", "thumbnail", "receipt").
title - title for your card. Must be a string.
subtitle - subtitle for your card. Must be a string.
text - text for your card. Must be a string.
images - list of images, in card attachment (to create image use method create_card_image). Must be a list.
buttons - list of buttons, in card attachment (to create button use method create_buttons). Must be a list.
=====================================================================================
Create image for card:
create_card_image(url, alt)
url - open url for your image.
alt - alternative text for image.
=====================================================================================
Create button(actions) for card:
create_button(button_type, title, value)
button_type - type of your button(e.g. "openUrl", "postBack").
title - name of button.
value - value of button(e.g. if button_type="openUrl", value="example.com").
=====================================================================================
Send card attachment to recipient:
send_card(bot_id, bot_name, recipient, reply_to_id, service, sender, message_type, card_attachment, text)
bot_id - skype bot id, you can get it from request data['recipient']['id'].
bot_name - skype bot name, you can get it from request data['recipient']['name'].
reply_to_id - the message id you are replying to, you can get it from request data['id'].
recipient - user, to whom you are sending the message. You can get it from request data['from'].
service - service url, you can get it from request data['serviceUrl'].
sender - conversation id, you can get it from request data['conversation']['id'].
message_type - if you send more than one card, choose display way("carousel" or "list").
card_attachment - list of cards, in message (to create cards use method create_card_attachment). Must be a list.
text - text of your message.
=====================================================================================
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
skype_chatbot-1.0.4.tar.gz
(4.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file skype_chatbot-1.0.4.tar.gz.
File metadata
- Download URL: skype_chatbot-1.0.4.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/38.4.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bdbd5c429b7a9cf280522da70881689c490348103d67affe2eab261e4685b10
|
|
| MD5 |
cca70a7b9c9b5d2f20a29f568b063dd3
|
|
| BLAKE2b-256 |
25700f1840d7e7b49c1fdf40dde3c45e0e3b2dcf9b9b69ec485fd9523607f08b
|
File details
Details for the file skype_chatbot-1.0.4-py3-none-any.whl.
File metadata
- Download URL: skype_chatbot-1.0.4-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/38.4.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c1d3047253cf1b22d6b49e7da2e90b8992f273a6bd8e0a041d9d87160c8ddc1
|
|
| MD5 |
9f412b8ef9e71255af6b1c14755bcc6e
|
|
| BLAKE2b-256 |
99cf3ccae779c7732af0176ce894b2469734cf7959068ec9c422dfeebcd8c824
|