Space
Space extends Room to represent a Matrix Space. It is returned by Bot.get_space() and Bot.get_spaces() instead of a plain Room whenever the room type is m.space.
from matrix import Bot
bot = Bot()
space = bot.get_space("!space123:matrix.org")
if space:
print(space.name)
matrix.space.Space
Space(matrix_room, client)
Bases: Room
Source code in matrix/room.py
46 47 48 | |
get_children
get_children(depth=1)
Return the child rooms and spaces of this space that the bot has joined.
Children the bot has not joined are silently omitted. Use depth to
recursively collect children of sub-spaces. depth=1 returns direct
children only (default).
Example
space = bot.get_space("!space123:matrix.org")
for child in space.get_children():
print(child.name)
for child in space.get_children(depth=3):
print(child.name)
Source code in matrix/space.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |