fdgt

website·Indexed 32 days ago

https://fdgt.dev

A mock API and drop-in replacement for the Twitch IRC API designed for Twitch developers. It allows developers to test events such as subscriptions, raids, bits, and channel mode changes (slowmode, emoteonly, subsonly) without requiring real actions on the Twitch platform.

Tokens
2.8K
Snippets
16
Records
24
Agent score
62%

What's inside fdgt

  1. Overview of fdgt mock API

    fdgt is a mock API designed as a drop-in replacement for the Twitch IRC API. It enables developers to test Twitch API events and build stream overlays without spending money on the actual Twitch platform, providing a testing apparatus that is otherwise unavailable in the official Twitch API ecosystem.
  2. Overview of fdgt for Twitch Developers

    fdgt is a drop-in replacement for Twitch IRC designed for developers building Twitch bots, overlays, and extensions. It allows developers to simulate Twitch API events (such as Tier 3 subscriptions or high-bit rewards) for testing purposes without incurring the actual costs associated with those events on the live Twitch platform.
  3. Handle the giftpaidupgrade event

    The giftpaidupgrade event is fired when a user upgrades their subscription from one that was previously gifted to them. This event provides details about the upgrading user and the original gifter.
    // Example event parameters for giftpaidupgrade
    interface GiftPaidUpgradeEvent {
      color: string;      // The color of the user's name in chat
      messageid: string;  // The ID of the message
      months: number;     // The number of months the subscription has been active (Default: 3)
      timestamp: string;  // The millisecond timestamp when the message was sent
      userid: string;     // The ID of the user sending the message
      username: string;    // The username of the user sending the message
      username2: string;  // The username of the user that originally gifted the sub
    }
  4. Handle primepaidupgrade events

    The primepaidupgrade global variable event is fired when a user upgrades their account from a Prime subscription to a paid subscription. This event provides details about the user and the specific subscription tier they have upgraded to.
    // Example of parameters received by the primepaidupgrade event
    interface PrimePaidUpgradeEvent {
      color: string;      // The color of the user's name in chat
      messageid: string;  // The ID of the message
      tier: number;      // The tier of the subscription being upgraded to (Default: 1)
      timestamp: string;  // The millisecond timestamp when the message was sent
      userid: string;     // The ID of the user sending the message
      username: string;   // The username of the user sending the message
    }
  5. Handle Twitch subscription extension events with `extendsub`

    The extendsub event is a global variable fired when a user extends their existing non-gifted subscription to a Twitch channel. It provides details about the user, the subscription tier, and the duration of the extension.
    // Example parameters received by the extendsub event:
    {
      color: string,      // The color of the user's name in chat
      messageid: string,   // The ID of the message
      months: number,      // The number of months the subscription is being extended (Default: 3)
      timestamp: string,   // The millisecond timestamp when the message was sent
      userid: string,      // The ID of the user sending the message
      username: string,    // The username of the user sending the message
      tier: number         // The tier of the subscription being extended (Default: 1)
    }
  6. Handle subgift events

    The subgift event is fired when a user gifts a subscription to another user in the channel. It provides details about both the sender and the recipient, as well as the subscription tier and duration.
    // Example of parameters available in a subgift event
    interface SubGiftEvent {
      color: string;      // The color of the user's name in chat
      count: string;      // Total number of gifts the user has given in the channel (Default: "1")
      messageid: string;  // The ID of the message
      months: number;     // Length of the gift sub for multi-month subs (Default: 1)
      tenure: number;     // Total months the recipient has been subscribed (Default: 1)
      tier: number;       // The tier of the subscription being extended (Default: 1)
      timestamp: string;  // Millisecond timestamp when the message was sent
      userid2: string;    // ID of the user receiving the sub
      username2: string;  // Username of the user receiving the sub
      userid: string;     // ID of the user sending the message
      username: string;    // Username of the user sending the message
    }
  7. Handle resubscription events

    resubscription events are fired when a user continues their existing, non-gifted subscription. This event provides details about the user's subscription tier, duration, and identity.
    // Example event parameters
    {
      color: string,      // The color of the user's name in chat
      messageid: string, // The ID of the message
      months: number,    // The number of months the user has been subscribed (Default: 3)
      prime: boolean,    // Whether this is a Prime subscription (Default: false)
      tier: number,      // The tier of the subscription being extended (Default: 1)
      timestamp: string, // The millisecond timestamp when the message was sent
      userid: string,    // The ID of the user sending the message
      username: string   // The username of the user sending the message
    }
  8. Handle mystery subscription gift events with submysterygift

    The submysterygift global variable event is fired whenever a user gives mystery subscription gifts in a channel. It provides details about the user, the number of gifts given, and message metadata.
    // Example parameters received during a submysterygift event
    {
      color: string,      // The color of the user's name in chat
      count: number,      // The number of gifts the user is currently giving (Default: 5)
      messageid: string,  // The ID of the message
      timestamp: string,  // The millisecond timestamp when the message was sent
      totalcount: number, // The total number of gifts the user has given in the channel (Default: 5)
      userid: string,     // The ID of the user sending the message
      username: string    // The username of the user sending the message
    }
  9. Handle Twitch bits events

    The bits global variable triggers an event whenever a user sends a message to a Twitch channel that contains bits. This event provides details about the user, the message content, and the number of bits sent.
  10. Handle raid events when a channel is raided

    The raid global variable/event is triggered when a channel is raided by another stream. It provides metadata about the raiding channel, including the username of the streamer and the number of viewers joining the raid.
    // Example of the data structure received during a raid event
    {
      username: "DrDisrespect", // The channel the raid is coming from
      viewercount: 10000,       // The number of viewers that joined the raid
      color: "#FF0000",        // The color of the user's name in chat
      messageid: "12345",      // The ID of the message
      timestamp: "1625000000", // Millisecond timestamp when the message was sent
      userid: "user_id_here"   // The ID of the user sending the message
    }
  11. Handle user subscription events with the `subscription` variable

    The subscription global variable is used to handle events that fire when a user subscribes to a channel for the first time. It provides metadata about the subscriber, including their username, user ID, subscription tier, and whether the subscription is a Prime membership.
  12. Connect a Twitch tool to fdgt for event simulation

    To use fdgt as a replacement for Twitch IRC and simulate events, change the IRC server endpoint in your application code from irc.twitch.tv to irc.fdgt.dev.
    // Replace: irc.twitch.tv
    // With:    irc.fdgt.dev