Easily connect your Godot games to Twitch chat. Log in with a single line of code to start reading messages right away. Features two docks for setting up the Twitch developer console and reading chat directly in the editor. Supports OIDC for seamless Twitch API interactions to write messages, timeout users, grant VIP status, and more.
Godot Very Simple Twitch requires Godot 4.2 or higher. You can check the Godot version you have installed in the bottom dock or your editor.
addons
folderaddons
folder to your game folderTo verify the installation is correct:
res://addons/very-simple-twitch
existsProject > Project Settings
Plugins
tabVery Simple Twitch
In order to use Very Simple Twitch, you will need to setup a new App in the Twitch developer console and perform the following steps:
Go to https://dev.twitch.tv/console/apps and authorize Twitch Developer to access your account.
Click on the "Register Your Application" button.
Name your application and set the Category to Game Integration
and the OAuth Redirect URL to http://localhost
for now.
Set your Client Type
to Public
Click on "Create".
Open the Very Simple Twitch dock in the bottom of your Godot editor.
Copy the Redirect URL addresses from the Twitch Quick Start tab to your Twitch Developer App.
That would be all! Everything is ready to use!
This is the easiest way to use the plugin. You can use VerySimpleTwitch.login_chat_anon("channel_name")
to connect to the channel without needing a token or any settings customization.
var channel_name: String = "channel_name"
VerySimpleTwitch.login_chat_anon(channel_name)
You can use VerySimpleTwitch.get_token_and_login_chat()
to retrieve the token and automatically login to the twitch chat
VerySimpleTwitch.get_token_and_login_chat()
Note: You will need to set up the CLIENT_ID in the Settings tab and configure the Twitch app accordingly.
To receive the Twitch chat messages, connect the chat_message_received
signal from VerySimpleTwitch. The signal contains all the information available from the chatter, including display_name, badges, tags and colors.
func _ready():
VerySimpleTwitch.chat_message_received.connect(print_chatter_message)
func print_chatter_message(chatter: Chatter):
print("Message received from %s: %s" % [chatter.tags.display_name, chatter.message])
To send chat messages you can use the VerySimpleTwitch.send_chat_message("Hello world")
static method. Sending chat messages is only available when you use OAuth connection method with a Token that has writting permissions.
Godot Very Simple Twitch has two docks. One at the bottom called Very Simple Twitch and one at the right called VSTChatDock. Each is used for a specific function:
As mentioned above, VST Chat Dock is a connection to the Twitch channel chat where all messages are displayed in the editor. This is useful for testing your project as it allows you to easily visualize what and when you are getting the messages.
If you are a Godot streamer, you can read your chat in the same window you are coding in.
Just add and activate the plugin as explained in the installation instructions, install the plugin as usual and you'll see a new tab in the right dock named "VstChatDock". Type in the name of a channel and click connect. You will see the messages as soon as the plugin connects.
You can change the Settings in Project > Project Settings > General > Very Simple Twitch
. Note that switching on the Advanced Settings
toggle will allow you to customize even more your client. Advanced Config are not supposed to be changed without further knowledge on how Twitch works.
This project is released under the MIT License by RothioTome (2024)