Skip to content
Open
Changes from 2 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
14 changes: 8 additions & 6 deletions examples/ding-dong-bot-oop.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ async def on_message(self, msg: Message):

hd_file_box: FileBox = await image.hd()
await hd_file_box.to_file('./hd-image.jpg', overwrite=True)

thumbnail_file_box: FileBox = await image.thumbnail()
await thumbnail_file_box.to_file('./thumbnail-image.jpg', overwrite=True)
artwork_file_box: FileBox = await image.artwork()
await artwork_file_box.to_file('./artwork-image.jpg', overwrite=True)

# reply the image
await msg.say(hd_file_box)
image_filebox = FileBox.from_file('./hd-image.jpg')
await room.say(image_filebox)
# await msg.say(hd_file_box)

elif msg_type==MessageType.MESSAGE_TYPE_URL:
content = await msg.to_url_link()
await room.say(content)

# pylint: disable=C0301
elif msg_type in [MessageType.MESSAGE_TYPE_AUDIO, MessageType.MESSAGE_TYPE_ATTACHMENT, MessageType.MESSAGE_TYPE_VIDEO]:
Expand Down