Twitch Calendar

Twitch Calendar

Key Features:

  • :calendar_spiral: Holiday Greeting: Automatically checks if today is a holiday and greets users with a configurable message as soon as they send their first message.
  • :rainbow_flag: Pronoun Support: Integrates with the alejo.io pronouns API to fetch user pronouns.
  • :globe_with_meridians: Holiday Fetching: Uses the date.nager.at API to fetch local, current, and upcoming holidays.
  • :tada: Predefined Holidays: Supports common holidays like:
    • Christmas Eve (Dec 24) :christmas_tree:
    • New Year’s Day (Jan 1) :fireworks:
    • Valentine’s Day (Feb 14) :heart:
  • :clipboard: Commands:
    • Trigger today’s holiday check.
    • View upcoming holidays.
  • :gift: Custom Holidays:
    • Add your own holidays to surprise your viewers!
    • Fully customizable .csv and .json files.

Import File

TwitchCalendar-v4.sb (25.5 KB)


Installation

In Streamer.bot click the Import button in the top menu. Drag the .sb file into the Import String field.

Enable all commands in the Commands tab


Step 1 - Setup: ..Setup Action..

  • Go to Folder Settings and set your %filePath% to your desired destination.
    filePath must lead to a folder!
  • Go to Calendar Settings and set the %countryCode% to your prefered country.
    Set your country code to fetch your local holidays. You can search for your country code here: Countries - Nager.Date
  • Run the trigger Test once to download/create all necessary files.
    Before running Test, go to Folder Settings and check if %updateFiles% is set to True or it only create the readme else!
  • Set %updateFiles% to False, so your files won’t get overwritten.
    Twitch-Calendar-README.txt will be created at your filePath with further explanations and guidance.
  • Since the script automatically add the upcoming holidays of next year automatically if it’s the 11th month of the current year, you can optionally activate %calendarYear% argument to stick with a specific years calendar.

What does ..Setup Action.. do?

  • Creates holidays.json, holidays.csv and Twitch-Calendar-README.txt at your desired folder destination.
  • You can modify the files and add custom holidays like chuck norris birthday and even add a custom message.
  • Custom holidays may or may not show up based on your settings for a potential surprising effect.

Step 2 - Setup: Check today's holiday & firstMessage

  • Go to Folder Settings and set your %filePath% to your desired destination.
    filePath must lead to the holidays.json!
  • Go to Customization if you want to add a generic message to all holidays if you didn’t edited the holidays.json or are using the CustomHolidayMessage arguments.

What does Check today's holiday & firstMessage do?

  • Greets users on their first message if it is currently a holiday.
  • Users can check anytime if there is a holiday currently (it will show official and your custom holidays)

Step 3 - Setup: Upcoming Holidays

  • Go to Folder Settings and set your %filePath% to your desired destination.
    filePath must lead to the holidays.csv!
  • Go to Calendar Settings to set the %language% argument to automatically translate parts of the message in to your prefered language.
  • Use the same code you used for the %countryCode% earlier.
    Default supported languages: DE, FR, US, ES, IT, NL, PT, RU, CN, JP, KR (fallback to english)
  • Go to Customizations to check if you want your custom holidays show up in the upcoming holidays message and how many of them should be listed.

What does Upcoming Holidays do?

  • Shows a list of upcoming holidays. The amount varies by your settings.
  • Shows additionally a list of all upcoming custom holdays if it is set.

Step 4 - Add custom holidays

To add custom holidays, you need to edit the .csv and .json file accordingly!

  1. Add a row in the holidays.csv.
    Example row: 2025-01-14,Test Tag,Test Day,CUSTOM,False,False,,,
  2. Either, update the .json yourself or run the Test trigger in the Core action, it will automatically create the new holiday in the customHolidays section. Keep in mind, running Test will overwrite any modifications in the .json
  3. (Optional) if you want to have persistent individual messages for any of your holidays, you can add args to the Check today's holiday & firstMessage action.

Example:



Disclaimer:
This script has been developed with input from the community and support by AI. If you run into any problems, let me know! :slight_smile:


Changelog:

v4

  • Fix: holidays.json falsely downloaded current and next year twice.
  • Fix: DefaultMessage weren’t populated correctly.

Let me know if there are issues :slight_smile:

Old Changelog

Hotfix v3.1

  • Fix: Script won’t greet anymore on first message if there is currently no holiday.
  • Fix: CustomHolidayMessage weren’t populated correctly everywhere.
  • Updated all Logs to use the right log-level and added brackets with their action name.

v3

  • Fix: %updateFiles% now refreshes the files correctly based on %countryCode% and year.
  • Fix: The year is not hardcoded anymore and the script automatically downloads the correct year.
  • Twitch Calendar automatically adds the next year to all files if the 11th month of the current year begins. It’ll show upcoming holidays of the next year.
  • Added the argument %calendarYear% which can be enabled, if you only want a specific year in you calendar files.
  • Renamed the Country sub-group of the Settings sub-action to: Calendar Settings in the ..Setup Action.. and Upcoming Holidays actions.
  • Changed file creation behavior. Removed countryCode and year from all files.
    So files are now: holidays.json and holidays.csv.

v2

  • Updated and redesigned all sub-action for sb 1.x.
  • Sorted all important sub-actions in sub-groups.
  • File/Folder handling for all actions should be now much easier.
  • ..Core Action.. renamed to ..Setup Action...
  • In ..Setup Action.. the argument %updateList% renamed to %updateFiles%
  • Fix: %updateFiles% won’t change files if it is set to False anymore unlike before.
  • %updateFiles% will always create the Twitch-Calendar-README.txt file to make sure users will have guidance.
  • Fix: Changed %country% to %countryCode% in the Country sub-group of the Settings sub-action, as it was wrong and had no effect.
  • Removed the Greetings on firstMessage action.
  • Renamed Check today's holiday to Check today's holiday & firstMessage as it practically always handled both but separated. You can just disable one of the trigger if one or another is not needed.
  • Added a new sub-action to Check today's holiday & firstMessage: outputMessage can be enabled, if you want a generic message for all holidays. It is not needed it you edit the DefaultMessage in the holidays.json directly or use the complementary MessageArgName to edit those messages anywhere else in sb.
  • Renamed 5 next holidays to Upcoming Holidays
  • Added a new sub-action: maxHolidays to the sub-group Customizations of the Settings sub-action of Upcoming Holidays.
  • The argument maxHolidays let you decide how many upcoming holidays should be displayed in chat. This was hardcoded to 5 before.
  • Updated pronouns handling with the alejo.io api.

Hotfix v2.1

  • User will not be greeted anymore if today is not a recognized holiday.

Update v2

  • reworked the whole script
  • added more informations here and there
  • added a .txt file with additional informations to filePath
  • added file support with some kind of automation
  • separated the firstMessage logic
  • removed unnecessary fallback methods in some scripts
  • many more

Update v1

  • Initial release

Looks cool! I use something similar with a birthday trigger Tawmae made and a shoutout command i made. Though i’m never a fan of messages triggering on First Words. I have it set with the birthdays to fire on frist words, but the shoutout counts messages/fires on the 6th. I feel like with the holidays it would be v annoying with raids to all automate at First Words.

not the most helpful feedback, but perhaps staggering it to be the third message? or only triggering with a !command might be better. though it would definitely be helpful as a streamer to see info about holidays in chat when i start stream! :slight_smile:

thanks for your input. You can disable the first word trigger and just use the command in the Check today's holiday & firstMessage action already :slight_smile: