This project provides a C# script for integrating weather information into Streamer.bot commands. It allows streamers to fetch and display current weather data during their streams using custom commands.
No subscription required! This script only uses free public services:
- Location search: OpenStreetMap Nominatim
- Weather data: Open-Meteo
Set the following Global Variables in Streamer.bot to control the default weather location:
weather_default_city: The default city name (e.g., "London")weather_default_lat: The latitude for the default city (e.g., "51.5074")weather_default_lon: The longitude for the default city (e.g., "-0.1278")
How the script behaves:
- No Global Values & No City Provided: Nothing will be shown; the command is ignored.
- Only
weather_default_citySet & No City Provided: The script will attempt to search for latitude and longitude for the default city using OpenStreetMap. - All Global Values Set & No City Provided: The weather for the specified latitude/longitude is returned immediately.
- City Provided: The script will search for the coordinates of the provided city and return its weather.
If none of the global values are set and no city is provided, the command will not return any weather information and will be ignored.
- Use
<command>(e.g.,!weather) to get the weather for your default location (as set in Global Variables). - Use
<command> <city>(e.g.,!weather Paris) to get the weather for a specific city (overrides the default). - The script works with Twitch, YouTube, and Kick, depending on your trigger setup in Streamer.bot.
- Setup the trigger command (e.g.,
!weather). - Setup the global variables as described above.
- Copy the contents of
Execute C# code.csinto a C# code action in Streamer.bot.
Example commands:
!weather(shows weather for default location)!weather Paris(shows weather for Paris)
- Twitch
- YouTube
- Kick
// ...existing code...
// Example usage in Streamer.bot:
// !weather LondonThis project is provided as-is for personal use. Please check the terms of your chosen weather API for usage restrictions.
I am a small streamer, please support me at twitch.tv/arnietw!