Skip to content

ArnieTW/Streamer.bot-Custom-First-Words

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 

Repository files navigation

Streamer.bot Custom First Words

A sophisticated first words announcement system for Streamer.bot that provides personalized welcome messages, TTS support, and intelligent stream validation.

Features

๐ŸŽฏ Personalized Messages

  • Custom user dictionary with personalized welcome messages for specific users
  • Role-based messages for mods, VIPs, subscribers, and followers
  • Fallback messages for new viewers

๐Ÿ”Š Text-to-Speech Integration

  • Custom TTS voices per user in the dictionary
  • Permission-based TTS for different user roles
  • Configurable default voice for unknown users
  • Smart voice fallback system

๐ŸŽฎ Smart Stream Validation

  • Hybrid validation system - trust known users, validate unknown ones
  • Clips-based verification to prevent stale game data
  • Configurable validation period (default: 30 days)
  • Per-user validation settings (deepCheck true/false)

๐Ÿ“บ Stream Information Display

  • Last streamed game information with Twitch link
  • Permission-controlled display for different user types
  • Intelligent filtering to show only active streamers

Installation

  1. Copy the code.cs file to your Streamer.bot project
  2. Create a new C# action in Streamer.bot
  3. Paste the code into the C# Code sub-action
  4. Configure the trigger for first-time chat messages
  5. Customize the settings (see Configuration section)

Configuration

๐Ÿ”ง Basic Settings

// Default TTS voice for all users
private string defaultTTSVoice = "EnglishTrans";

// Number of days to validate recent clips
private int clipValidationDays = 30;

// Use default voice when specific voice unavailable
private bool useDefaultVoiceIfUnavailableKnown = true;

๐Ÿ‘ฅ Adding Custom Users

Add users to the knownUsers dictionary:

{ "username", getArg => (
    "Custom welcome message for @username!", 
    "VoiceName", 
    false  // deepCheck: false = trusted, true = validate clips
) }

Parameters:

  • Message: Custom welcome message with @username placeholder
  • TTS Voice: Specific voice for this user (or string.Empty for no TTS)
  • Deep Check: false = trusted (no validation), true = validate with clips

๐ŸŽญ Role-Based Messages

Customize messages in GetMessageText() method:

if (isMod) {
    return "Mod message here";
} else if (isVIP) {
    return "VIP message here";
} else if (isSub) {
    return "Subscriber message here";
} else if (isFollowing) {
    return "Follower message here";
} else {
    return "New viewer message here";
}

๐Ÿ” Permission Controls

Stream Info Display Permissions:

private bool AllowUnknownUsersLastStreamed(bool isMod, bool isSub, bool isVIP, bool isFollowing)
{
    return isMod || isVIP;  // Only mods and VIPs see stream info
}

TTS Permissions:

private bool AllowUnknownUsersTTS(bool isMod, bool isSub, bool isVIP, bool isFollowing)
{
    return isMod || isVIP || isSub;  // Mods, VIPs, and subs get TTS
}

How It Works

๐Ÿ”„ Validation Logic

  1. Known Users: Uses individual deepCheck setting from dictionary

    • deepCheck = false: Trusted - shows stream info without validation
    • deepCheck = true: Validates recent clips before showing stream info
  2. Unknown Users: Always validates with recent clips

    • Only shows stream info if clips exist within clipValidationDays
    • Prevents stale game data from inactive accounts

๐Ÿ“‹ Message Flow

  1. User enters chat for the first time
  2. System checks if user is in knownUsers dictionary
  3. If known: Uses custom message, TTS voice, and validation setting
  4. If unknown: Uses role-based message and permission checks
  5. Validates stream info based on user type and settings
  6. Sends announcement and TTS (if permitted)

๐ŸŽฏ Example Outputs

Known User (Trusted):

*Base Drops* @Z3roDamage is here to liven up the party! Last Streamed: Valorant at: twitch.tv/z3rodamage

Unknown User (Validated):

Cool sunglasses, a fedora, lots of swag - @SomeVIP is here!! Last Streamed: Minecraft at: twitch.tv/somevip

New Viewer:

Howdy weary traveller @NewViewer! feel free to Relax and vibe~

Supported Languages

๐ŸŒ Multi-Language Support

  • English: EnglishTrans
  • Japanese: JapanesePreTrans
  • Mix and match languages per user

Example Japanese user:

{ "japanese_user", getArg => (
    "@{0} ใ“ใ‚“ใซใกใฏ๏ผใ‚ˆใ†ใ“ใ๏ผ", 
    "JapanesePreTrans", 
    false
) }

Troubleshooting

๐Ÿ”ง Common Issues

TTS Not Working:

  • Verify TTS voice names are correct
  • Check permission settings
  • Ensure messageStripped parameter is available

Stream Info Not Showing:

  • Check clipValidationDays setting (try increasing)
  • Verify user permissions in AllowUnknownUsersLastStreamed()
  • For known users, check their deepCheck setting

Clips Validation Failing:

  • Some streamers don't have clips despite being active
  • Set trusted users to deepCheck = false to bypass validation
  • Adjust clipValidationDays for more lenient validation

๐Ÿ“Š Debugging

The script includes comprehensive logging:

  • Stream validation results
  • Clip checking status
  • User permission checks
  • Error handling with fallbacks

Check Streamer.bot logs for detailed information about script execution.

Customization Examples

๐ŸŽจ Special Event User

{ "special_guest", getArg => (
    "๐ŸŽ‰ SPECIAL GUEST @{0} HAS ARRIVED! ๐ŸŽ‰", 
    "EnglishTrans", 
    false
) }

๐ŸŽฎ Gaming Buddy

{ "gaming_friend", getArg => (
    "My gaming buddy @{0} is here! Ready to get wrecked? ๐Ÿ˜„", 
    "EnglishTrans", 
    true  // Still validate their clips
) }

๐Ÿ”‡ Silent User

{ "quiet_user", getArg => (
    "The mysterious @{0} has appeared...", 
    string.Empty,  // No TTS
    false
) }

Requirements

  • Streamer.bot (latest version recommended)
  • C# Code Action capability
  • TTS Integration (for voice features)
  • Twitch Integration (for clips validation)

Contributing

Feel free to submit issues, feature requests, or improvements to enhance the script's functionality.

I'm a small streamer who likes to Code so if you will use this code, please give some kind of contribution/shoutout to ArnieTW @Twitch.tv to help me with making content!~

License

This project is open source. Feel free to modify and distribute according to your needs.


Created for the Streamer.bot community ๐ŸŽฎโœจ

About

Simple yet extensive code for "First Words" setup for Twitch.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages