def create_animation_card(self): card = AnimationCard( media=[MediaUrl(url="https://media4.s-nbcnews.com/j/newscms/2020_26/3392002/antimicrobial-face-masks-kr-2x1-tease-200623_2597ed8310508184ab2a3fdba151fded.fit-1240w.gif")], title="Learn how to use your mask :)", subtitle="For your protection against COVID-19", ) return CardFactory.animation_card(card)
def create_animation_card(url: str) -> Attachment: card = AnimationCard( title="Animation Card", media=[MediaUrl(url=url)], autostart=True, ) return CardFactory.animation_card(card)
def create_animation_card(self) -> Attachment: card = AnimationCard( media=[MediaUrl(url="http://i.giphy.com/Ki55RUbOV5njy.gif")], title="Microsoft Bot Framework", subtitle="Animation Card", ) return CardFactory.animation_card(card)
def create_audio_card(self) -> Attachment: card = AudioCard( media=[MediaUrl(url="https://wavlist.com/wav/father.wav")], title="I am your father", subtitle="Star Wars: Episode V - The Empire Strikes Back", text= "The Empire Strikes Back (also known as Star Wars: Episode V – The Empire Strikes " "Back) is a 1980 American epic space opera film directed by Irvin Kershner. Leigh " "Brackett and Lawrence Kasdan wrote the screenplay, with George Lucas writing the " "film's story and serving as executive producer. The second installment in the " "original Star Wars trilogy, it was produced by Gary Kurtz for Lucasfilm Ltd. and " "stars Mark Hamill, Harrison Ford, Carrie Fisher, Billy Dee Williams, Anthony " "Daniels, David Prowse, Kenny Baker, Peter Mayhew and Frank Oz.", image=ThumbnailUrl( url= "https://upload.wikimedia.org/wikipedia/en/3/3c/SW_-_Empire_Strikes_Back.jpg" ), buttons=[ CardAction( type=ActionTypes.open_url, title="Read more", value= "https://en.wikipedia.org/wiki/The_Empire_Strikes_Back", ) ], ) return CardFactory.audio_card(card)
def create_animation_card_breathe(self) -> Attachment: card = AnimationCard(media=[ MediaUrl( url="https://media.giphy.com/media/UW8VVu5c2OBUy43cos/giphy.gif" ) ], title="Take Your Mind Off") return CardFactory.animation_card(card)
def create_animation_card_hanginthere(self) -> Attachment: card = AnimationCard(media=[ MediaUrl( url="https://media.giphy.com/media/W63ZJmQ4qdblTM9Wbi/giphy.gif" ) ], title="Hang In There") return CardFactory.animation_card(card)
def test_should_create_audio_card_attachment(self): media = [MediaUrl(url='https://example.org/media')] card = AudioCard(title='test', media=media) attachment = CardFactory.audio_card(card) assert_attachment(attachment, CardFactory.content_types.audio_card) assert attachment.content.title == 'test', 'wrong title.' assert_media(attachment.content.media, 1, ['https://example.org/media'])
def test_should_create_animation_card_attachment(self): media = [MediaUrl(url="https://example.org/media")] card = AnimationCard(title="test", media=media) attachment = CardFactory.animation_card(card) assert_attachment(attachment, CardFactory.content_types.animation_card) assert attachment.content.title == "test", "wrong title" assert_media(attachment.content.media, 1, ["https://example.org/media"])
def create_animation_card(self) -> Attachment: card = AnimationCard(media=[ MediaUrl( url="https://media.giphy.com/media/fxe8v45NNXFd4jdaNI/giphy.gif" ) ], title="Sample Animation Card", subtitle="Bye Bye") return CardFactory.animation_card(card)
def create_animation_card(gif_name) -> Attachment: file_path = os.path.join(os.getcwd(), "resources/" + gif_name + ".gif") card = AnimationCard( media=[MediaUrl(url=urljoin('file:', pathname2url(file_path)))], title="Microsoft Bot Framework", subtitle="Animation Card", ) return CardFactory.animation_card(card)
def create_audio_card(self) -> Attachment: card = AudioCard() card.media = [ MediaUrl(url="https://wavlist.com/wav/apli-airconditioner.wav") ] card.subtitle = "Bot Framework Audio Card using python" card.title = "Lets play an audio" card.image = ThumbnailUrl( url="https://pypi.org/static/images/logo-small.6eef541e.svg") return CardFactory.audio_card(card)
def create_distance_animation_card(self): card = AnimationCard( media=[ MediaUrl( url= "https://www.verywellmind.com/thmb/W4VojprlVzyEMentRI2IMaEHDQU=/900x900/smart/filters:no_upscale()/social-distancing-color021-4c03a3a03b1a4eb9bde32a49596d4d9b.gif" ) ], title="Learn about social distance :)", subtitle="For your protection against COVID-19", ) return CardFactory.animation_card(card)
def create_video_card() -> Attachment: card = VideoCard(title='Big Buck Bunny', subtitle='by the Blender Institute', text='Big Buck Bunny (code-named Peach) is a short computer-animated comedy film by the Blender ' 'Institute, part of the Blender Foundation. Like the foundation\'s previous film Elephants ' 'Dream, the film was made using Blender, a free software application for animation made by ' 'the same foundation. It was released as an open-source film under Creative Commons License ' 'Attribution 3.0.', media=[MediaUrl(url='http://download.blender.org/peach/bigbuckbunny_movies/' 'BigBuckBunny_320x180.mp4')], buttons=[CardAction(type=ActionTypes.open_url, title='Learn More', value='https://peach.blender.org/')]) return CardFactory.video_card(card)
def create_video_card(self) -> Attachment: card = VideoCard( title="Big Buck Bunny", subtitle="by the Blender Institute", text= "Big Buck Bunny (code-named Peach) is a short computer-animated comedy film by the Blender " "Institute, part of the Blender Foundation. Like the foundation's previous film Elephants " "Dream, the film was made using Blender, a free software application for animation made by " "the same foundation. It was released as an open-source film under Creative Commons License " "Attribution 3.0.", media=[ MediaUrl( url="http://download.blender.org/peach/bigbuckbunny_movies/" "BigBuckBunny_320x180.mp4") ], buttons=[ CardAction( type=ActionTypes.open_url, title="Learn More", value="https://peach.blender.org/", ) ], ) return CardFactory.video_card(card)
def create_audio_card(url: str) -> Attachment: card = AudioCard(title="Audio Card", media=[MediaUrl(url=url)], autoloop=True) return CardFactory.audio_card(card)
def create_video_card(url: str) -> Attachment: card = VideoCard( title="Video Card", media=[MediaUrl(url=url)], ) return CardFactory.video_card(card)
def create_animation_card() -> Attachment: card = AnimationCard( media=[MediaUrl(url='http://i.giphy.com/Ki55RUbOV5njy.gif')], title='Microsoft Bot Framework', subtitle='Animation Card') return CardFactory.animation_card(card)
def create_animation_card(self) -> Attachment: card = AnimationCard( media=[MediaUrl(url="http://i.giphy.com/Ki55RUbOV5njy.gif")], title="Sample Animation Card", subtitle="Hey am Bot Demo using python") return CardFactory.animation_card(card)