irc3.plugins.web
Web plugin¶
Introduce a web interface to post messages
Install aiohttp:
$ pip install aiohttp
Usage:
This example show how to define the web server config:
>>> config = ini2config("""
... [bot]
... includes =
... irc3.plugins.web
...
... [irc3.plugins.web]
... host = 127.0.0.1
... port = 8080
... api_key = toomanysecrets
... """)
>>> bot = IrcBot(**config)
Then you’ll be able to post a message to a channel using curl:
$ curl -H "X-Api-Key: toomanysecrets" --data Hello http://127.0.0.1:8080/channels/irc3