Categorygithub.com/yi-jiayu/bus-eta-bot/v4
modulepackage
4.2.0
Repository: https://github.com/yi-jiayu/bus-eta-bot.git
Documentation: pkg.go.dev

# README

Bus Eta Bot

Weekly Users Build Status CircleCI codecov Go Report Card

A practical Telegram bot for getting bus etas in Singapore supporting refreshing, bus stop search and showing nearby bus stops.

Getting started

Telegram: @BusEtaBot

Features

Get etas by bus stop code

Etas by bus stop code

Get etas by bus stop code and service

Etas by bus stop code and service

Send a location to get nearby bus stops

Looking up nearby bus stops

Search bus stops by bus stop code, description or road name

Searching bus stops

Get nearby bus stops

Location-based inline query

Send etas as inline messages

Inline message

# Packages

Package mocks is a generated GoMock package.
No description provided by the author
No description provided by the author

# Functions

AboutHandler handles the /about command.
CalculateEtas calculates the time before buses arrive from the LTA DataMall bus arrival response.
ChosenInlineResultHandler handles a chosen inline result.
DefaultHandlers returns a default set of handlers.
EtaCallbackHandler handles callback queries from eta messages from old versions of the bot for backwards-compatibility.
EtaDemoCallbackHandler handles an eta_demo callback from a start command.
EtaHandler handles the /eta command.
No description provided by the author
EtaTable generates the table of bus etas used in a eta message.
FallbackCommandHandler catches commands which don't match any other handler.
FeedbackCmdHandler handles the /feedback command.
No description provided by the author
No description provided by the author
HelpHandler handles the /help command.
HideFavouritesCmdHandler hides the favourites keyboard.
InferEtaQuery extracts a bus stop ID and service numbers from a text message.
InlineQueryHandler handles inline queries.
LocationHandler handles messages contain a location.
NewBot creates a new Bus Eta Bot with the provided tgbotapi.BotAPI and datamall.APIClient.
No description provided by the author
No description provided by the author
NewEtaHandler sends etas for a bus stop when a user taps "Get etas" on a bus stop location returned from a location query.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewMeasurementProtocolClientWithClient constructs a MeasurementProtocolClient with the provided tid and http.Client.
No description provided by the author
No description provided by the author
NewStreetViewAPI returns a StreetViewAPI with an API key.
No description provided by the author
PrivacyHandler handles the /privacy command.
RefreshCallbackHandler handles the callback for the Refresh button on an eta message.
ShowFavouritesCmdHandler will display a reply keyboard for quick access to the user's favourites.
EuclideanDistanceAtEquator returns the approximate squared distance between two points near the equator.
StartHandler handles a /start command.
TextHandler handles incoming text messages.
ToggleFavouritesHandler handles the toggle favourite callback button on etas.
VersionHandler handles the /version command.

# Constants

Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Event actions.
Application details.
Application details.
Application details.
Event categories.
Event categories.
Event categories.
Event categories.
Event categories.
Event categories.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Links to relevant documents.
No description provided by the author
No description provided by the author
No description provided by the author
Event labels.
No description provided by the author
Measurement Protocol constants.
Measurement Protocol constants.
Measurement Protocol constants.
NearbyBusStopsRadius is the search range in metres for inline queries for nearby bus stops.
Links to relevant documents.
Links to relevant documents.
ResponseBufferSize is the size of the channel used to queue responses to be sent via the Telegram Bot API.
StreetViewEndpoint is the endpoint for the Street View Image API.
Version is the current Bus Eta Bot version.

# Variables

No description provided by the author
No description provided by the author

# Structs

No description provided by the author
BusEtaBot contains all the bot's dependencies.
BusEtas represents the calculated time before buses arrive at a bus stop.
BusStop represents a bus stop.
CallbackData represents the data to be included with the Refresh inline keyboard button in eta messages.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Favourites contains a user's saved favourites.
Handlers contains all the handlers used by the bot.
HitParsingResult contains whether the a hit is valid and additional information fom the validation server.
IncomingBuses contains information about incoming buses for a single service at a bus stop.
No description provided by the author
MeasurementProtocolClient contains the endpoint, tracking id and http client to use to send hits to the Measurement Protocol.
No description provided by the author
ParserMessage is a message from the validation server parser.
No description provided by the author
StreetViewAPI contains information for making a request to the Street View Image API.
SummaryETAFormatter displays ETAs for up to the next 3 buses at a bus stop.
No description provided by the author
No description provided by the author
ValidationServerResponse is a response from the Measurement Protocol Validation Server.

# Interfaces

No description provided by the author
BusStopRepository provides bus stop information.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

CallbackQueryHandler is a handler for callback queries.
CommandHandler is a handler for incoming commands.
MessageHandler is a handler for incoming messages.