CCI

Navigation

  • Home
  • Getting Started
    • First Launch and Setup
    • Sockets: Which One To Pick
    • Finding Your Socket Key
      • Streamlabs
      • StreamElements
      • DonationAlerts
      • Twitch PubSub
        • The OAuth Token, and its Scopes
        • Generating the right OAuth Token
      • Twitch Chat
      • YouTube Chat
    • The CCI Editor
    • Dissecting an Event
    • The Anatomy of an Event Configuration
    • Processing an Event
    • The Client Mod Config File
    • CCI on Servers
  • Intermediate Guides
    • Intermediate Difficulty, the old Advanced Difficulty
    • Getting the Most Out of Your Event Configuration
    • Constants, the Solution to Insanity
    • I'm Making A Note Here, Huge Success!
    • Debugging the PEBKAC Issue
    • Configuring a Socket Remotely with Online Configs
  • Advanced Guides
    • Advanced Difficulty, the new Advanced Difficulty
    • Libraries: Not The Book Kind
    • Debugging When Debugging Fails
    • When Variable Insertion Goes Wrong
    • Defaults: Setting Variables on Load
    • Strings: Untying the Knot
    • Arrays: The Black Sheep of Variables
  • Expert Guides
    • Expert Difficulty, for Advanced Advanced Users
    • Game Event Hooks: The Config Maker's Nightmare
  • How To's
    • How To's, a How To
    • Commonly Asked How To's
    • Capturing Twitch's Channel Point Rewards
    • Converting a Twitch Name to Minecraft Name
  • Libraries
    • Still Not The Book Kind
  • Components
    • Event Configuration
      • Event Configuration
      • Configuration
      • Event
      • Condition
        • Condition
        • Array
          • ArrayAppendCondition
          • ArrayCombineCondition
          • ArrayCondition
          • ArrayDeleteCondition
          • ArrayExplodeCondition
          • ArrayLengthCondition
        • String
          • Unconditional
            • Base64DecodeCondition
            • Base64EncodeCondition
            • StringCompareToCondition
            • StringConcatCondition
            • StringIndexOfCondition
            • StringLengthCondition
            • StringLowerCaseCondition
            • StringReplaceCondition
            • StringSplitCondition
            • StringTrimCondition
            • StringUpperCaseCondition
          • StringContainsCondition
          • StringEndsWithCondition
          • StringEqualsCondition
          • StringStartsWithCondition
          • StringSubStringCondition
        • Variable
          • Unconditional
            • VariableInsertCondition
            • VariableRemoveCondition
          • VariableCondition
          • VariableExistsCondition
          • VariableIsArrayCondition
          • VariableIsNumberCondition
        • Unconditional
          • ArithmeticCondition
          • LocalisedStringCondition
          • LogArgsCondition
          • NullCondition
          • RandomNumberCondition
          • RandomStringCondition
          • RepeatCondition
          • RequestStatisticsCondition
        • ConditionalCondition
        • ConstantCondition
        • GameSettingsCondition
        • InventoryCondition
        • JsonSafeCondition
        • MessageCondition
        • ModExistsCondition
        • MultipleConditionCondition
        • NoteCondition
        • NotesListCondition
        • PlayerStateCondition
        • RandomCondition
        • RangedAmountCondition
        • ReadFileCondition
        • ServerCondition
        • SpecificAmountCondition
        • SpecificUserCondition
        • StatisticsCondition
        • TargetCondition
        • TargetExistsCondition
        • TwoHighSpaceCondition
      • Outcome
        • Outcome
        • CCI
          • CCIChangeProfileOutcome
          • CCIClearQueueOutcome
          • CCIFromJsonOutcome
          • CCISendEventToSocket
          • CCISendToPlayerOutcome
        • ChatMessageOutcome
        • CommandOutcome
        • ConditionalOutcome
        • ConstantOutcome
        • EventOutcome
        • FakeCrashOutcome
        • FoodOutcome
        • GameCrashOutcome
        • GameSettingsOutcome
        • HealthOutcome
        • IMCOutcome
        • InputOutcome
        • InventoryOutcome
        • KeyPressOutcome
        • MotionOutcome
        • MountOutcome
        • MultipleOutcomeOutcome
        • NarratorOutcome
        • NoteDeletionOutcome
        • NoteOutcome
        • NullOutcome
        • ObjectAccessorOutcome
        • PopupOutcome
        • PromptOutcome
        • ReadFromUrlOutcome
        • RepeatOutcome
        • SoundOutcome
        • ToastOutcome
        • WriteToFileOutcome
      • Constants
    • Game Event Config
      • Game Event Config
      • Listener
      • Object Accessor
      • Param Injector

Getting Your Twitch PubSub OAuth Token

Note
PubSub support is the newest and least documented support that CCI has and may be subject to change. I don’t even know how long the OAuth keys last, so consider this your warning that things can go wrong.



The OAuth Token, and its Scopes

If you’ve made a chat-bot before, you might be a bit familiar with making an OAuth token with custom scopes. If you haven’t, no worries, I’ll walk you through it the whole way nonetheless.

CCI requires a set of specific scopes to listen to specific topics. What this means is that you have to define those scopes when generating your OAuth token, or else CCI will not be able to listen to those topics.

Scope Topic
bits:read channel-bits-events-v2
channel-bits-badge-unlocks
channel-bit-events-public
channel-cheer-events-public-v1
chat:read user-moderation-notifications
channel:moderate chat_moderator_actions
automod-queue
channel:read:hype_train hype-train-events-v1.rewards
hype-train-events-v1
channel:read:polls polls
channel:read:predictions predictions-channel-v1
channel:read:redemptions community-points-channel-v1
channel-points-channel-v1
channel:read:subscriptions channel-subscribe-events-v1
channel-sub-gifts-v1
Scope uncertain, possibly not required leaderboard-events-v1.bits-usage-by-channel-v1
leaderboard-events-v1.sub-gifts-sent
following
raid
celebration-events-v1

These are the topics that CCI listens to. If you leave any scope out in your OAuth token, those topics will not be listened to when CCI runs. If you know the right scope a certain topic belongs to, do not hesitate to correct this guide.


Generating the right OAuth Token

So, we’re going to need an OAuth token. I personally used twitchtokengenerator.com, and have made a quick link with the set scopes for you to use. When you get there, it will look something like this:



Scroll down, check the scopes if you want to, and click on Generate Token!



Click on that, and here you’ll be taken to the Twitch page to authorize. Be sure to check the domain again and ensure it points to id.twitch.tv, double check the Scopes, then hit the Authorize button. CCI isn’t responsible if something happens to your account because you didn’t validate these details.



Solve the CAPTCHA if you get one, then you’re shown your Access Token (this is your OAuth token), and a Refresh Token. Keep them both somewhere safe, you’ll need them in the future. I had to generate a new token just for this guide, so I hope you’re happy.



And those are your tokens. That’s what CCI needs.

Built with MkDocs using a custom theme. Hosted by Read the Docs. ReadTheDocs project base taken from Minecraft Forge with permission.
Enable Dark Theme