Support file URLs
This commit is contained in:
parent
987a07e921
commit
12f3a0fc6f
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 <lukewm@riseup.net>"]
|
||||
maintainers = ["decentral1se <lukewm@riseup.net>"]
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue