Add ability to query a single homeserver.

This commit is contained in:
Scott Wallace 2020-07-14 17:44:36 +01:00
parent d6b1062fe8
commit f5933792eb
3 changed files with 21 additions and 16 deletions

View file

@ -3,3 +3,4 @@ A simple [maubot](https://github.com/maubot/maubot) that displays everyone's hom
## Usage ## Usage
* `!shame` - Reply with a list of homeservers and their respective running versions. * `!shame` - Reply with a list of homeservers and their respective running versions.
* `!shame server.example.com` - Reply with the version for the homeserver provided, server.example.com.

View file

@ -1,6 +1,6 @@
maubot: 0.1.0 maubot: 0.1.0
id: sh.wallace.matrix.shameotron id: sh.wallace.matrix.shameotron
version: 0.0.2 version: 0.0.3
license: MIT license: MIT
modules: modules:
- shameotron - shameotron

View file

@ -99,11 +99,15 @@ class ShameOTron(Plugin):
@command.new('shame', help='Show versions of all homeservers in the room') @command.new('shame', help='Show versions of all homeservers in the room')
async def shame_handler(self, evt: MessageEvent) -> None: @command.argument("candidate", pass_raw=True, required=False)
async def shame_handler(self, evt: MessageEvent, candidate: str = None) -> None:
""" """
Class method to handle the `!shame` command Class method to handle the `!shame` command
""" """
event_id = await evt.reply('Loading member list...') event_id = await evt.reply('Loading member list...')
if candidate:
member_servers = [candidate]
else:
member_servers = await self._load_members(evt.room_id) member_servers = await self._load_members(evt.room_id)
# Filter out the "dead servers" # Filter out the "dead servers"