API Reference f1_bot v0.7.0
modules
Modules
API for retrieving data between different system components.
Common functions for analysis
Calculates per-lap gap to the leader for creating visualizations
Collects lap times for creating visualizations
Handles Discord command management and event processing.
Factory functions for composable Discord commands
Handles Discord command for creating graphs
Parses and validates Discord command options
Functions for composing and sending responses to slash commands.
Handles Discord command for displaying driver's session summary
A signalR client that establishes a websocket connection to the live timing API and handles
all received events by forming F1Bot.F1Session.LiveTimingHandlers.Packet structs and passing them to
F1Bot.F1Session.LiveTimingHandlers for processing.
Decoding & decompression functions for inflating certain live timing API data feeds (e.g. telemetry)
HTTP client for SignalR connection negotiation.
Holds all state related to a given F1 session and coordinates data processing across modules in F1Bot.F1Session scope.
Generic storage for time-series information such as car telemetry.
Stores and handles changes to personal driver information.
Personal information about a driver.
Coordinates processing, generates events and holds data (F1Bot.F1Session.DriverDataRepo.DriverData)
belonging to each driver (e.g. laps, top speeds, car telemetry, car position), as well as the overall
session statistics, such as the overall fastest lap and top speed.
Processes and holds personal best and session-best statistics, such as fastest lap times, sector times, and top speed.
Coordinates processing and stores data for a driver, e.g. laps, fastest lap, car telemetry, stint data and more.
Helper functions to generate events for F1Bot.F1Session.DriverDataRepo functions.
Holds information about a single lap.
Stores all information about laps driven by a driver in the current session, e.g. lap number, lap time and timestamp.
Holds information about a single sector.
Holds information about a single stint.
Stores all information about driver's stints in the current session, e.g. tyre compount and tyre age.
Generates a driver summary that includes fastest lap, top speed and summarized stint information (stint laps, tyre compound, average & minimum lap time)
Stores current and maximum lap number for the session
Router for all packets ingested from F1 SignalR websocket API
Handler for car telemetry received from live timing API.
Handler for driver list updates received from live timing API.
Handler for extrapolated clock which keeps track of remaining session time, useful for qualifying.
Handler for lap count updates received from live timing API.
Struct that contains information about every packet received from the live timing API.
Handler for car position received from live timing API.
Packet processing options.
Handler for race control messages received from live timing API.
Handler for session information updates received from live timing API.
Handler for session status received from live timing API.
Handler for stint information (tyre changes) received from live timing API.
Handler for lap times and sector times received from live timing API. The handler parses drivers' information and passes it on to the F1 session instance.
Handler for track status received from live timing API.
Stores and generates events for messages from race control.
GenServer that holds the live F1Bot.F1Session instance, acts as an entrypoint for
incoming live timing packets and executes all side effects by passing event messages to
F1Bot.Output.Discord via PubSub.
Stores and handles changes to current session information.
Stores intervals when the race is neutralized (VSC, SC, red flag)
Listens for events published by F1Bot.F1Session.Server, composes messages for Discord
and calls a configured Discord client (live or console) to send them.
Given a base URL of a live timing dataset, this module takes care of downloading known
.jsonStream datasets, pre-processes them into a single stream of live timing packets,
and consecutively processes them using arbitrary implementations.
All options are optional unless otherwise noted.
The entrypoint for defining your web interface, such as controllers, components, channels, and so on.
properties
Properties
- chart_id :string, required: true
- class :css_class, default: ""
properties-1
Properties
id :string, required: true - The id of the live component (required by LiveView for stateful components).
properties-2
Properties
- driver_list :list, required: true
- drivers_of_interest :list, required: true
events
Events
- toggle_driver, required: true
properties-3
Properties
id :string, required: true - The id of the live component (required by LiveView for stateful components).
properties-4
Properties
- is_race :boolean, required: true
- lap_counter :any, required: true
- session_clock :any, required: true
properties-5
Properties
id :string, required: true - The id of the live component (required by LiveView for stateful components).
properties-6
Properties
- id :string, required: true
- href :uri, required: true
- class :css_class, default: ""
- width :integer, default: 1000
- height :integer, default: 500
slots
Slots
- default, required: true
properties-7
Properties
id :string, required: true - The id of the live component (required by LiveView for stateful components).
A component that renders a tyre symbol.
properties-8
Properties
id :string, required: true - Both the DOM ID and the ID to uniquely identify a LiveView. An
:idis automatically generated when rendering root LiveViews but it is a required option when rendering a child LiveView.
properties-9
Properties
id :string, required: true - Both the DOM ID and the ID to uniquely identify a LiveView. An
:idis automatically generated when rendering root LiveViews but it is a required option when rendering a child LiveView.
mix-tasks
Mix Tasks
Downloads archives of previous races and runs an offline backtest which prints all Discord messages to console.