Provide a respond function

Closes https://git.autonomic.zone/decentral1se/xbotlib/issues/34.
This commit is contained in:
2021-01-19 08:29:56 +01:00
parent 73df47eb45
commit e7adfeaa51
3 changed files with 15 additions and 2 deletions

View File

@ -626,3 +626,7 @@ class Bot(ClientXMPP):
return self.reply(cleandoc(self.help), **kwargs)
except AttributeError:
return self.reply("No help found 🤔️", **kwargs)
def respond(self, response, content_type="text/html"):
"""Send this response back with the web server."""
return Response(response, content_type=content_type)