Closed HeroicNate closed 3 years ago
I'll look into it. As long as you set 'get_images' to true, emotes and badges should be cached in RAM. When also enabling 'disk_cache', emotes and badges will also be stored to disk so that you don't have to download them again. Don't forget to specify a cache path as well if you enable the disk cache.
The procedure would then be;
The process is still cumbersome now that I look into it, will probably do some more adjustments.
Currently it doesn't seem to work at all.
Thanks a lot for bringing this to my attention.
Ok. I hadn't tried to use the emotes yet but maybe the issue is related to the emitters not firing.
I was not able to detect the emitters at all for some reason, so listening for "chat_message" would never activate.
Other signals do work for me. How are your currently using them?
At the moment all I'm trying to do it respond to the signal
func _on_Gift_chat_message(sender_data, message, channel): print("chatted")
or even directly in the script itself:
func _on_chat_message(sender_data, message, channel): print("chatted")
It never fires, but the function processing the message does activate because I can put all the functionality I want right into it.
But are you connecting the signal to the function properly?
Edit: I think I know why you are having trouble. Currently, the 'channel' parameter in the signal is unused (I forgot to remove it), so your function might only work if you only accept 2 params. The channel is contained in the sender_data. The debugger should also give a hint that this might be the issue;
emit_signal: Error calling method from signal 'chat_message': 'Node(Gift.gd)::chat_message': Method expected 3 arguments, but called with 2.
To fix it, simply only declare your function with 2 params:
func _ready() -> void:
connect_to_twitch()
yield(self, "twitch_connected")
authenticate_oauth("#####", "oauth:######")
if(yield(self, "login_attempt") == false):
print("Invalid username or token.")
return
join_channel("#####")
connect("chat_message", self, "chat_message")
func chat_message(sender_data, message):
print("message received")
That solved it.
To create the signal listener I did it in the Node signal menu: https://cdn.discordapp.com/attachments/663542917540872215/756178926128332840/unknown.png
First of all this is awesome! I've got it mostly working though I don't really know how the emotes are suppose to work.
The issue I'm having is the signals. I've been searching through the code but can't seem to find if there was some sort of emitter on off code. If I build my own emitters they work, but I can't tap into the ones already in the code. I try connecting to them but they never seem to fire. Any suggestions?