Skip to content

Commit

Permalink
Notes: handle for caption trigger
Browse files Browse the repository at this point in the history
Change-Id: I7662754d31c21835e88f23e760eea5383b581d37
  • Loading branch information
adekmaulana committed May 31, 2022
1 parent aed8ccf commit 1bec2ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion anjani/plugins/notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

0 comments on commit 1bec2ac

Please sign in to comment.