Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion chat/client-libraries/cloud/create_message_app_cred.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,47 @@ def create_message_with_app_cred():
# Replace SPACE_NAME here.
parent = "spaces/SPACE_NAME",
message = {
"text" : "Hello with app credential!"
"text": '👋🌎 Hello world! I created this message by calling ' +
'the Chat API\'s `messages.create()` method.',
"cards_v2" : [{ "card": {
"header": {
"title": 'About this message',
"image_url": 'https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/info/default/24px.svg'
},
"sections": [{
"header": "Contents",
"widgets": [{ "text_paragraph": {
"text": '🔡 <b>Text</b> which can include ' +
'hyperlinks 🔗, emojis 😄🎉, and @mentions 🗣️.'
}}, { "text_paragraph": {
"text": '🖼️ A <b>card</b> to display visual elements' +
'and request information such as text 🔤, ' +
'dates and times 📅, and selections ☑️.'
}}, { "text_paragraph": {
"text": '👉🔘 An <b>accessory widget</b> which adds ' +
'a button to the bottom of a message.'
}}
]}, {
"header": "What's next",
"collapsible": True,
"widgets": [{ "text_paragraph": {
"text": "❤️ <a href='https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.reactions/create'>Add a reaction</a>."
}}, { "text_paragraph": {
"text": "🔄 <a href='https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/patch'>Update</a> " +
"or ❌ <a href='https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/delete'>delete</a> " +
"the message."
}
}]
}
]
}}],
"accessory_widgets": [{ "button_list": { "buttons": [{
"text": 'View documentation',
"icon": { "material_icon": { "name": 'link' }},
"on_click": { "open_link": {
"url": 'https://developers.google.com/workspace/chat/create-messages'
}}
}]}}]
}
)

Expand Down
76 changes: 0 additions & 76 deletions chat/client-libraries/cloud/create_message_app_cred_with_cards.py

This file was deleted.

9 changes: 8 additions & 1 deletion chat/client-libraries/cloud/create_message_user_cred.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ def create_message_with_user_cred():
# Replace SPACE_NAME here.
parent = "spaces/SPACE_NAME",
message = {
"text": "Hello with user credential!"
"text": '👋🌎 Hello world!' +
'Text messages can contain things like:\n\n' +
'* Hyperlinks 🔗\n' +
'* Emojis 😄🎉\n' +
'* Mentions of other Chat users `@` \n\n' +
'For details, see the ' +
'<https://developers.google.com/workspace/chat/format-messages' +
'|Chat API developer documentation>.'
}
)

Expand Down
2 changes: 1 addition & 1 deletion chat/client-libraries/cloud/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
google_auth_oauthlib==1.2.0
protobuf==4.21.12
google-apps-chat==0.1.0
google-apps-chat==0.1.9