TwitchSync 1.4

Give rewards to subscribers or followers!

  1. Okx
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    This plugin will allow you to give your Twitch subscribers or followers. special rewards on your server. You may give them a rank and/or execute commands, but it requires a little bit of setting up first.

    Prerequisites:
    1. Your server must be hosted on a VPS or Dedicated server. Shared hosting will not work.
    2. A web server on port 8080 (configurable) will be setup automatically.

    Setup is as follows:
    1. Log in on https://dev.twitch.tv/
    2. Then, click your name in the top right hand corner, and in the drop-down menu, click "Dashboard".
    3. Click "Apps"
    4. On the right hand side, click "+ Register Your Application"
    5. Choose a name, such as "Yourname Minecraft Subscriber sync"
    6. This name will be shown to your users when they sync their account.
    7. In the redirect URI, put http://your-server-ip:8080 if you have a domain over your server IP, you may use that as a replacement for the IP.
    8. Make sure that you copy the client ID, and copy & generate a client secret. You'll need those two later.
    9. Turn your Minecraft server off
    10. Place this plugin inside it
    11. Turn your Minecraft server on, and then turn it back off after the plugin has generated its config.
    12. In the config file, put in your channel name, the client ID, and your client secret.
    13. You will also need to replace redirect-uri with the redirect URI you put in Twitch earlier
    14. Change anything else as you see fit. However, you will likely not need to change server-port.
    15. Start your server.
    16. You may now run /twitchsync in-game. It will open a URL, which you should click on. You will then be redirected to the redirect URI you set up earlier.
    17. If all goes well, you should receive the message "You have successfully received the Twitch subscription rewards.". If you receive an unknown error message, try again a few times. If the problem persists, enable debug-mode in the config and PM me the console logs when you receive the unknown error message.
    Configuration
    This is the default configuration for TwitchSync.
    Code (Text):
    # The channel name(s) to check for subscription/follows.
    channel-names:
    - required

    # The client ID given by Twitch.
    client-id: required

    # The client secret given by Twitch. Remember not to tell anyone this!
    client-secret: required

    # Port to host the HTTP server on
    server-port: 8080

    # Redirect URI for Twitch authentication. This has to be set as the same as Twitch
    redirect-uri: http://localhost:8080

    # How many minutes it takes for twitch sync URLs to expire.
    expiry-time: 10

    # Note that these messages are sent by the web server and use HTML, not chat formatting.
    messages:
      subscription:
        no-subscription-program: "The channel does not have a subscription program set up."
        success: "You have successfully received the Twitch subscription rewards."
      follow:
        success: "You have successfully received the Twitch following rewards."
      success-both: "You have received both the following and subscription rewards."

      # If you have subscription or following rewards disabled you might want to change this
      # to say "You are not following" or "You are not subscribed" to make it clear
      # that it's only possible to get rewards for one thing
      not-both: "You are neither subscribed or are following the channel."
      already-done: "You have already redeemed subscription and/or follow rewards."

      state-not-found: "This link has either expired, or already been used."
      player-not-found: "We cannot find you on the server. Are you online?"
      invalid-url: "The URL is invalid"
      unknown-error: "An unknown error occurred. Please try again."

    # What to do when somebody subscribes
    subscribe:
      enabled: true

      # Rank to give a player. Only used if Vault and a permissions plugin is installed.
      # Set to 'none' to disable.
      rank: 'Subscriber'

      # Commands to execute.
      # You can use the following placeholders:
      # %name% - name of the player who subscribed
      # %channel% - channel their subscription is registered to
      # %channelid% - channel id of %channel%
      commands:
      - 'broadcast %name% has subscribed!'
      - 'give %name% diamond 1'
    # What to do when somebody follows
    follow:
      enabled: true
      rank: 'Follower'
      commands:
      - 'broadcast %name% has followed the channel!'

    # Enable debugging information.
    # If you encounter an unexpected error please enable this
    # and send the results to the dev!
    debug-mode: false

    To give ranks, you require Vault.

    The command is /twitchsync and it takes no arguments.

    Developers

    The plugin provides two events: PlayerSubscriptionEvent and PlayerFollowEvent.

    They both extend PlayerEvent and provide an additional method named getChannelId()

    Issues


    If you experience any issues please join my Discord. Make sure you enable debug-mode in the config file and send me your console output and config file.

Recent Updates

  1. Revoke expired subscriptions
  2. Multiple channel support
  3. Big update