A very simple plugin to connect your Godot games to the Twitch chat. It's possible to Login with just one line of code and start reading the messages. Custom settings for different environments and more complex login methods are also supported.
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.
- Clone the project or download last release.
- If you cloned the project, extract the
addons
folder - Move the
addons
fodler to your game folder
To verify the installation is correct:
- The folder path
res://addons/very-simple-twitch
exists - Go to
Project > Project Settings
- Click in the
Plugins
tab - Enable
Very Simple Twitch
- Restart Godot
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
VerySimpleTwitch.get_token_and_login()
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_msg)
func print_chatter_message(chatter: Chatter):
print("Message received from %s: %s % [chatter.tags.display_name, escape_bbcode(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.
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)