A Telegram Bot to collect location information from users and export the coordinates to a map service.
- Install the bot. (Add
--user
if you are not root.)
pip install git+https://github.com/chstem/TelegramUserMapBot.git
-
Create a new Telegram Bot by talking to @BotFather
-
Create a new map, for example at uMap.
-
Copy
config.json.template
to/etc/TelegramUserMapBot/config.json
and edit. Add your bot token, obtained from @BotFather. -
After each update, the data is exported to a CSV or GeoJSON file. In
config.json
you can set up a path for that file, which is publicly accessible on your webserver. Add its URL to the map service as "remote data" source, so it can fetch updates automatically. -
If you want journald based logging set
log_file
tojournald
in/etc/TelegramUserMapBot/config.json
. -
Finally, run
telegramusermapbot
.
List of commands to setup via @BotFather
region - Pass your hometown or next largest city.
geo - Pass coordinates.
map - Get map link.
get - Show your saved location.
delete - Delete your stored information.
intro - Shows a short introduction.
help - Shows all available commands.