From e890a3902355bc912b4655833d0553cafdd2e117 Mon Sep 17 00:00:00 2001 From: shiyu22 Date: Mon, 12 Jul 2021 14:54:20 +0800 Subject: [PATCH 1/3] Update reply image && Add reply URL --- examples/ding-dong-bot-oop.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/ding-dong-bot-oop.py b/examples/ding-dong-bot-oop.py index aee98226..2b02937c 100644 --- a/examples/ding-dong-bot-oop.py +++ b/examples/ding-dong-bot-oop.py @@ -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 community.say(image_filebox) + # await msg.say(hd_file_box) + + elif msg_type==MessageType.MESSAGE_TYPE_URL: + content = await msg.to_url_link() + await community.say(content) # pylint: disable=C0301 elif msg_type in [MessageType.MESSAGE_TYPE_AUDIO, MessageType.MESSAGE_TYPE_ATTACHMENT, MessageType.MESSAGE_TYPE_VIDEO]: From 4bcf3c1042b77c322b387f36a101262f33955807 Mon Sep 17 00:00:00 2001 From: shiyu22 Date: Tue, 13 Jul 2021 16:23:06 +0800 Subject: [PATCH 2/3] update --- examples/ding-dong-bot-oop.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ding-dong-bot-oop.py b/examples/ding-dong-bot-oop.py index 2b02937c..f0237f09 100644 --- a/examples/ding-dong-bot-oop.py +++ b/examples/ding-dong-bot-oop.py @@ -63,12 +63,12 @@ async def on_message(self, msg: Message): # reply the image image_filebox = FileBox.from_file('./hd-image.jpg') - await community.say(image_filebox) + 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 community.say(content) + await room.say(content) # pylint: disable=C0301 elif msg_type in [MessageType.MESSAGE_TYPE_AUDIO, MessageType.MESSAGE_TYPE_ATTACHMENT, MessageType.MESSAGE_TYPE_VIDEO]: From 3b0b5c18efb1006c429ef40a3e215780fc220c13 Mon Sep 17 00:00:00 2001 From: shiyu22 Date: Mon, 2 Aug 2021 11:45:00 +0800 Subject: [PATCH 3/3] update --- examples/ding-dong-bot-oop.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/ding-dong-bot-oop.py b/examples/ding-dong-bot-oop.py index f0237f09..6b4adc63 100644 --- a/examples/ding-dong-bot-oop.py +++ b/examples/ding-dong-bot-oop.py @@ -63,12 +63,11 @@ async def on_message(self, msg: Message): # reply the image image_filebox = FileBox.from_file('./hd-image.jpg') - await room.say(image_filebox) - # await msg.say(hd_file_box) + await msg.say(image_filebox) elif msg_type==MessageType.MESSAGE_TYPE_URL: content = await msg.to_url_link() - await room.say(content) + await msg.say(content) # pylint: disable=C0301 elif msg_type in [MessageType.MESSAGE_TYPE_AUDIO, MessageType.MESSAGE_TYPE_ATTACHMENT, MessageType.MESSAGE_TYPE_VIDEO]: