Skip to content

shirtlessfounder/launchontwitch

Repository files navigation

Twitch Token Launcher Bot

A Twitch chat bot that launches Solana tokens directly on pump.fun or bonk.fun platforms by responding to @launchonpump and @launchonbonk mentions.

How It Works

  1. Dual Bot Names: Bot responds to @launchonpump (for pump.fun) and @launchonbonk (for bonk.fun)
  2. Channel Monitoring: The bot joins specified Twitch channels and monitors chat
  3. Screenshot Capture: Automatically captures stream screenshots as token images
  4. Direct Launch: Launches tokens directly on the respective platforms

Prerequisites

  • Node.js 18+ installed
  • Solana wallet with SOL for launching tokens
  • Twitch account for the bot
  • Twitch application (for API access - needed for stream screenshots)
  • (Optional) Pinata account for IPFS image storage

Setup Instructions

1. Create Bot Accounts

  1. Create two Twitch accounts:
    • launchonpump - for pump.fun launches
    • launchonbonk - for bonk.fun launches
  2. Go to https://twitchapps.com/tmi/ (logged in as one of the bot accounts)
  3. Generate an OAuth token
  4. Save the OAuth token (starts with oauth:)

2. Create a Twitch Application (for API access)

  1. Go to https://dev.twitch.tv/console/apps
  2. Click "Register Your Application"
  3. Fill in the details:
  4. Save your Client ID and Client Secret

3. Install Dependencies

npm install

4. Configure Environment

Copy env.example to .env and fill in your values:

cp env.example .env

Required configurations:

  • TWITCH_BOT_OAUTH: OAuth token from step 1 (works for both bot accounts)
  • TWITCH_CLIENT_ID: Client ID from step 2
  • TWITCH_CLIENT_SECRET: Client Secret from step 2
  • TWITCH_CHANNELS: Comma-separated list of channels to monitor
  • SOLANA_RPC_URL: Solana RPC endpoint
  • RENTER_PRIVATE_KEY: Private key of wallet to launch tokens from

5. Run the Bot

npm start

Usage

Two Ways to Launch Tokens

Method 1: Quick Launch (One Command)

@launchonpump $TICKER + Token Name
@launchonbonk $TICKER + Token Name

This captures a screenshot at the moment of the command and launches immediately.

Method 2: Screenshot First, Name Later

  1. First, capture the perfect moment:

    @launchonpump
    @launchonbonk
    

    Bot responds: "✅ Screenshot saved! Now send: $TICKER + Token Name"

  2. Then, within 5 minutes, send your token details:

    $TICKER + Token Name
    

Examples

Quick Launch:

  • @launchonpump $PEPE + Pepe Token (launches on pump.fun)
  • @launchonbonk $DOGE + Doge Coin (launches on bonk.fun)

Two-Step Launch:

  1. @launchonpump (captures screenshot)
  2. $MOON + Moon Token (launches with saved screenshot)

How Channel Access Works

Option 1: Bot as Moderator (Recommended)

  • Add your bot as a moderator in channels you control
  • Bot can send messages without rate limits
  • Most reliable for high-volume usage

Option 2: Public Channels

  • Bot can join any public channel
  • Subject to Twitch's rate limits for non-mods
  • May get timed out if sending too many messages

Option 3: Your Own Channel

  • Create a channel for the bot account itself
  • Users can go to twitch.tv/YourBotName and use commands there
  • Full control, no permission issues

Testing the Bot

  1. Start the bot: npm start
  2. Open Twitch: Go to one of your configured channels
  3. Test command: Type @YourBotName $TEST + Test Token
  4. Check response: Bot should reply with token creation status

Rate Limits & Considerations

  • Twitch has rate limits: 20 messages per 30 seconds for regular users
  • If bot is a moderator: 100 messages per 30 seconds
  • Consider adding cooldowns between token creations
  • Images must be publicly accessible URLs

Token Launch Details

  • Bonk.fun: 30 SOL initial liquidity, 85 SOL raising target
  • Pump.fun: 85 SOL initial liquidity, 69 SOL market cap
  • Tokens are launched directly on-chain with actual transactions
  • Each launch includes a small initial buy (0.0001 SOL)
  • Transaction fees are paid by the launcher wallet

Stream Screenshot Feature

When no custom image URL is provided:

  1. Bot captures the current stream frame using Twitch API
  2. Uploads the screenshot to IPFS
  3. Uses it as the token's official image

This creates a unique memento of the exact moment the token was created!

Security Notes

  • Never share your OAuth token or private keys
  • Use environment variables, not hardcoded values
  • Keep your launcher wallet funded but not with large amounts
  • Monitor for abuse/spam
  • Consider implementing rate limits per user

Troubleshooting

Bot not connecting:

  • Check OAuth token is valid
  • Ensure bot username matches the account that generated the token
  • Verify channel names are lowercase

Stream screenshots not working:

  • Ensure stream is live
  • Check Twitch Client ID and Secret are correct
  • Verify the channel name is correct
  • Note: Twitch preview images may have a slight delay (5-10 seconds)

Commands not working:

  • Bot must be able to send messages in the channel
  • Check bot is actually in the channel (you'll see connection logs)
  • Ensure mention format is correct: @BotName

Token creation fails:

  • Verify Solana RPC is accessible
  • Ensure launcher wallet has enough SOL
  • Check all environment variables are set
  • Verify wallet private key format (hex, base58, or JSON array)

Development

Run in development mode with auto-restart:

npm run dev

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors