ContribBot_REPO
- 2 Devlogs
- 2 Total hours
This bot isn't slacking off, it replies to messages 24/7!
This bot isn't slacking off, it replies to messages 24/7!
Used API keys from OpenStreetMap and implemented a city, Country based system.
Important functions used for /beatifymaps.
parseMapsCommand(text)
Reads what the user typed after /beatifymaps. It decides if the user wants help, place search, or distance mode.
geocodePlace(query)
Searches OpenStreetMap for a place like Tokyo, Japan or Los Angeles.
getNominatimHeaders()
Adds the required User-Agent header for OpenStreetMap Nominatim.
getDistanceMiles(fromPlace, toPlace)
Calculates distance between two places using their latitude and longitude.
buildPlaceResponse(query, place)
Creates the nice Slack Block Kit card for one searched place.
buildDistanceResponse(fromPlace, toPlace, distanceMiles)
Creates the nice Slack Block Kit card for distance between two places.
buildFlagImageUrl(countryCode)
Creates a flag image URL for the country.
getOpenStreetMapUrl(place)
Creates the “View Map” button link.
👍Still debugging and polishing the github token credit. Right now jsut plain text with github profile name with number of commits . Still need to add more features