Skip to main content

Module spaceapi

Module spaceapi 

Source
Expand description

Query SpaceAPI endpoints and observe membership changes.

Retrieves and monitors members presence at the hackerspace using a compatible SpaceAPI

§Configuration

ModuleConfig

[module."notbot::spaceapi"]
presence_interval = 30
empty_response = "Nikdo není doma..."
# keywords = [ "at" ]

[module."notbot::spaceapi".presence_map]
"https://hackerspace.pl/spaceapi" = [
    "#members:hackerspace.pl",
    "#notbot-test-private-room:is-a.cat",
    "#bottest:is-a.cat"
]

[module."notbot::spaceapi".room_map]
"default" = "https://hackerspace.pl/spaceapi"
"#members" = "https://hackerspace.pl/spaceapi"

§Usage

Keywords:

  • at - at_processor - return the list of names listed as present by SpaceAPI endpoint set for current room.
  • hm, heatmap - heatmap - render a heatmap of activity based on the data returned by spaceapi endpoints.

Passive presence updates: presence_observer

Notice(notbot) -> #members:hackerspace.pl: arrived: foo, also there: bar, baz
Notice(notbot) -> #members:hackerspace.pl: left: foo, still there: bar, baz
Notice(notbot) -> #members:hackerspace.pl: left: bar, still there: baz

Modules§

heatmap_api
Module for making interactions with the heatmap API, including rendering data it returns, easier.
space_api
Structure for data retrieved from SpaceAPI endpoints.

Structs§

ModuleConfig
SpaceAPI module configuration

Functions§

at_processor
Query configured SpaceAPI for presence state.
heatmap
Present a heatmap of people activity at the Hackerspace
names_dehighlighted
Insert \u{200B} - unicode Zero Width Space - in between the first and remaining characters of present people names, to avoid unnecessary mentions in the chat Room of people present.
presence_observer
Worker observing SpaceAPI endpoints for changes and providing updates to configured rooms.