changed 3 years ago
Linked with GitHub

Matrix bot querying taginfo in Opsdroid framework

Matrix is a decentralized/federated communication protocol with quite some adoption in our community https://wiki.openstreetmap.org/wiki/Matrix

Opsdroid is open source chatbot framework written in Python.

Motivation

Adding (very simple) taginfo chatbot to our local OSM group and have some fun.

Prior knowledge of Opsdroid - none at all. Actually never ever wrote a single line of python before. And I'm not a coder either, looks like a proper challenge :)

I won't describe Opsdroid in details as it has very good documentation I needed:

skill is basically functionality of a bot which reacts to varios commands, in my case I wanted to trigger bot via &tg command with parameters "key" and "value" e.g. "highway" and "steps" like below however our matrix room is bridged with xmpp room and it caused issues as & was translated to html entities so I changed it to !tg

!tg highway=track

or for highway combinations

!tg highway=*

or single word for value search

!tg steps

I took sample hello skill and used it as a base; putting it all together was at the end quite a breeze (apart from not knowing python and shooting myself in the foot several times) also their matrix channel #opsdroid-general:matrix.org helped me; it can be found at https://github.com/mahdi1234/opsdroid-taginfo with comments for each action.

How does it look from matrix side then

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

and from jabber/xmpp side

This was just small PoC, to add all the complexity of taginfo API is maybe future project :)

Select a repo