From 1bec2ac6738d07d58ffe5fbf04adabe3bc172875 Mon Sep 17 00:00:00 2001 From: Adek Date: Tue, 31 May 2022 23:56:07 +0700 Subject: [PATCH] Notes: handle for caption trigger Change-Id: I7662754d31c21835e88f23e760eea5383b581d37 --- anjani/plugins/notes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/anjani/plugins/notes.py b/anjani/plugins/notes.py index 8d61447f2..216b90919 100644 --- a/anjani/plugins/notes.py +++ b/anjani/plugins/notes.py @@ -80,7 +80,8 @@ async def on_plugin_restore(self, chat_id: int, data: MutableMapping[str, Any]) @listener.filters(filters.regex(r"^#[\w\-]+(?!\n)$")) async def on_message(self, message: Message) -> None: """Notes hashtag trigger.""" - return await self.get_note(message, message.text.lstrip("#")) + trigger = message.text or message.caption + return await self.get_note(message, trigger.lstrip("#")) async def get_note(self, message: Message, name: str, noformat: bool = False) -> None: """Get note data and send based on types."""