diff --git a/CHANGELOG.md b/CHANGELOG.md index 71f94b0..4fc4e4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # xbotlib x.x.x (UNRELEASED) +# xbotlib 0.12.3 (2021-01-17) + +- Support OOB URLs in `SimpleMessage` + # xbotlib 0.12.2 (2021-01-17) - Support loading Jinja2 template ([#30](https://git.autonomic.zone/decentral1se/xbotlib/issues/30)) diff --git a/README.md b/README.md index cf04baf..a11f6e5 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ Attributes: - **receiver**: the receiver of the message - **nick**: the nickname of the sender - **type**: the type of message +- **url**: The URL of a sent file ## Working with your bot diff --git a/pyproject.toml b/pyproject.toml index c4abbfd..ea08649 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api" [tool.poetry] name = "xbotlib" -version = "0.12.2" +version = "0.12.3" description = "XMPP bots for humans" authors = ["decentral1se "] maintainers = ["decentral1se "] diff --git a/xbotlib.py b/xbotlib.py index 0aa292b..f24a116 100644 --- a/xbotlib.py +++ b/xbotlib.py @@ -85,6 +85,11 @@ class SimpleMessage: """The nick of the message.""" return self.message["mucnick"] + @property + def url(self): + """The URL of a sent file.""" + return self.message["oob"]["url"] + class Config: """Bot file configuration.""" @@ -533,6 +538,7 @@ class Bot(ClientXMPP): self.register_plugin("xep_0045") # Multi-User Chat self.register_plugin("xep_0199") # XMPP Ping self.register_plugin("xep_0084") # User Avatar + self.register_plugin("xep_0066") # Proces URIs (files, images) try: for plugin in self.plugins: