- Newest Testing Version!
- Only for Cards in google Hangouts bot YET
- Testing Version, Full version will be in the release
Table of Contents
from GoogleChatApi import *
from GoogleChatApi.CardObjects import *
# make a message
message = Message([]) # the list is optional
# One message object can contain more than one card
CardObj = Message.CardObj()
#One Card Object only can have one header
header = Header(["rickroll",
"rickroll", # subtitle, optional
"<Image Link>", #Image Link,optional
"Image"]) # or "Avatar" #Image Type,optional, if you have a Image Type or Image Link, you need both of them
# One Card Object can contain more than one Widgets
widgets = Message.CardObjWidgets()
# One Widget can contain more than one Text Paragraph
paragraph = TextParagraph('<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ">Rick Roll video</a>') # Html text
# One Widget can contain more than one Image
image = Image('https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg', https://www.youtube.com/watch?v=dQw4w9WgXcQ') # ImageUrl and The Website to open when click on it
CardObj.SetHeader(header) # Set the head of the Card
Widgets.add(paragraph) # Add the TextParagraph to the widget
Widgets.add(image) # Add the Image to the widget
CardObj.AddWidget(widgets) # Add the widget to the Card
message.addCardObj(CardObj) # Add the Card!
message.send("<The Bot Url>")
finally, after this whole lot of code, you now sent the message!
- Readme "Sending them" problem fixed
- Image
- Change Log
- Readme Added
- Have access to Send a card message