All Projects → drtwisted → godot-twicil

drtwisted / godot-twicil

Licence: MIT License
Godot TwiCIL – Godot Twitch Chat Interaction Layer

Programming Languages

GDScript
375 projects

Projects that are alternatives of or similar to godot-twicil

-godot-gj-api
GameJolt API plugin for Godot Engine
Stars: ✭ 45 (-21.05%)
Mutual labels:  godot, godot-engine
godot-uuid
Unique identifier generation v4 for Godot Engine
Stars: ✭ 96 (+68.42%)
Mutual labels:  godot, godot-engine
godot-size-benchmarks
Benchmarks to compare Godot binary sizes with different build-time options
Stars: ✭ 36 (-36.84%)
Mutual labels:  godot, godot-engine
Freedom-Hunter
Monster Hunter like action RPG game
Stars: ✭ 71 (+24.56%)
Mutual labels:  godot, godot-engine
discord.gd
Discord Bot API wrapper for Godot. Make bots in GDScript.
Stars: ✭ 69 (+21.05%)
Mutual labels:  godot, godot-engine
godot-ci
Docker image to export Godot Engine games. Templates for Gitlab CI and GitHub Actions to deploy to GitLab Pages/GitHub Pages/Itch.io.
Stars: ✭ 316 (+454.39%)
Mutual labels:  godot, godot-engine
OpMon-Godot
An open source Pokemon-inspired game, now with Godot
Stars: ✭ 50 (-12.28%)
Mutual labels:  godot, godot-engine
godot-nightly
A program to download the latest version of Godot Nightly Builds
Stars: ✭ 23 (-59.65%)
Mutual labels:  godot, godot-engine
twitch-chatlog
Fetch the chatlog to a twitch VOD from your command line.
Stars: ✭ 78 (+36.84%)
Mutual labels:  twitch, irc
GodotDiscordSDK
A Discord Game SDK wrapper for Godot, written in C.
Stars: ✭ 40 (-29.82%)
Mutual labels:  godot, godot-engine
godot-shotgun-party
An evolving multiplayer project for Godot Engine 3.
Stars: ✭ 171 (+200%)
Mutual labels:  godot, godot-engine
godot-polygon2d-fracture
A simple script for fracturing polygons. Also adds nice helper functions for polygons like calculateArea, triangulate, getRandomPointsInPolygon, getBoundingRect)
Stars: ✭ 148 (+159.65%)
Mutual labels:  godot, godot-engine
twitchchat
interface to the irc portion of Twitch's chat
Stars: ✭ 80 (+40.35%)
Mutual labels:  twitch, irc
Logic-Circuit-Simulator
A free and open-source Logic Circuit Simulator built in Godot Engine.
Stars: ✭ 23 (-59.65%)
Mutual labels:  godot, godot-engine
godot-plugin-refresher
Adds a dropdown and refresh button combo to the toolbar for instantly toggling off/on a plugin. Enables faster workflows for Godot plugin developers.
Stars: ✭ 104 (+82.46%)
Mutual labels:  godot, godot-engine
godot-lod-demo
Demonstration project for the Level of Detail (LOD) Godot 3.x add-on
Stars: ✭ 34 (-40.35%)
Mutual labels:  godot, godot-engine
godopy
[WIP] Python scripting for the Godot game engine
Stars: ✭ 27 (-52.63%)
Mutual labels:  godot, godot-engine
Godot-3.0-Noise-Shaders
Godot 3.0 Noise Shaders
Stars: ✭ 38 (-33.33%)
Mutual labels:  godot, godot-engine
Fake-Interior-Shader-for-GodotEngine
Interior Mapping shader for the Godot Game Engine 3.x that works with both GLES3 and GLES2.
Stars: ✭ 40 (-29.82%)
Mutual labels:  godot, godot-engine
BrainfuckIDE
A Brainfuck IDE/debugger designed to be intuitive, featureful and visually appealing
Stars: ✭ 77 (+35.09%)
Mutual labels:  godot, godot-engine

Godot TwiCIL -- Godot Twitch Chat Interaction Layer

NOTE: ATM master branch contains TwiCIL v1.3.0-legacy (for Godot 2.x), latest changes brouhgt with v2.0.0 are at godot3.1 branch. In the future things will switch around.

Description

An abstraction layer for Godot Engine to enable interaction with twitch chat.

A basic explanation is available in this video (1.5x speed is recomended :D)

GodotTwiCIL Brief Tutorial

TODO:

  • Implement secure connection over WS for 3.1.x (should have built in tools for the purpose)
  • Add aliases for chat commands
  • Manage user states (connected/disconnected/banned users?)
  • Investigate if it's possible to actively ask server for user list (at least add update of users list on new message)
  • Implement retrieval of emote images

How to use

  1. Create your Twitch API application here
  2. Generate a new OAUTH-Token here

Assuming you have added TwiCIL node to your scene:

onready var twicil = get_node("TwiCIL")

var nick = "MySuperGame"
var client_id = "myClient1D"
var oauth = "oauth:my0auTh"
var channel = "channel_name"

func _setup_twicil():
  twicil.connect_to_twitch_chat()
  twicil.connect_to_channel(channel, client_id, oauth, nick)
  
  # Enable logging (disabled by default)
  twicil.set_logging(true)
  
  # Add custom commands to game bot
  twicil.commands.add("hi", self, "_command_say_hi", 0)
  twicil.commands.add("bye", self, "_command_say_bye_to", 1)
  twicil.commands.add("!w", self, "_command_whisper", 0)

  # Add some aliases
  twicil.commands.add_aliases("hi", ["hello", "hi,", "hello,", "bye"])
  
  # Remove command/alias
  twicil.commands.remove("bye")

func _command_say_hi(params):
  var sender = params[0]
  
  twicil.send_message(str("Hello, @", sender))

func _command_say_bye_to(params):
  var sender = params[0]
  var recipient = params[1]
  
  twicil.send_message(str("@", recipient, ", ", sender, " says bye! TwitchUnity"))

func _command_whisper(params):
  var sender = params[0]
  
  twicil.send_whisper(sender, "Boo!")

func _ready():
  _setup_twicil()

API

Methods

Method Params Description
connect_to_twitch_chat -- Establishes connection to Twitch IRC Chat Server
connect_to_channel channel -- channel name to connect to; client_id -- your client_id obtained from Twitch Developer Dashboard; password -- your oauth code obtained from Twitch Developer Dashboard; nickname -- nickname of account your app will be authorized in chat; realname (optional) -- not quite sure if it's necessary, but can be the same as nickname; Joins specified chat using provided credentials
set_logging state -- boolean state Enable/disable logging communication with server to stdout
connect_to_host host -- host IP or FDQN; port -- host port Establishes connection to specified host:port
send_command command -- raw text which is sent Sends specified command/text directly to the server
send_message text -- message text Sends a regular message to the chat
send_whisper recipient -- has to be a valid user name; text -- message text Whispers (PM) a message to the specified user

Signals

Signal Params Description
message_recieved sender -- sender nickname; text -- message text Emitted on new messages sent to chat
raw_response_recieved response -- raw response from Twitch IRC server Emitted on any response from Twitch IRC server received
user_appeared user -- user nickname Emitted on user join notification received from server. NOTE: this has a server delay of several minutes
user_disappeared user -- user nickname Emitted on user part notification received from server. NOTE: this has a server delay of several minutes

Manage interactive commands

Method Params Description
commands. add chat_command -- command text to react to; target -- target object on which method_name will be invoked; method_name -- method name to be invoked on the target object; params_count=1 -- parameters the command expects to be accepted as valid (optional param, default is 1); variable_params_count=false -- indicates if command can be called with any params count including none (optional param, default is false -- params count is mandatory). NOTE: Params are sent to callback as a list. First list member is ALWAYS sender nickname. See example godot-twicil-example.gd) Add command text chat_command to trigger method_name on target object and count command valid if params_count amount of params is specified, or call it in any case if variable_params_count is set to true
commands. add_aliases chat_command -- command text alias(es) is/are set to; aliases -- a list of aliases to add to reaction of chat_command Add aliases to chat_command to list of reactions.
commands. remove chat_command -- command (or alias) text reaction is set to Remove command (or alias) from list of reactions
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].