tmijs / tmi.js

💬 Javascript library for the Twitch Messaging Interface. (Twitch.tv)
https://tmijs.com
MIT License
1.54k stars 216 forks source link

action command not using /me, instead just puts ACTION at the beginning of message #426

Open ghost opened 3 years ago

ghost commented 3 years ago

Actual behaviour: When using the client.action command(channel, message), instead of sending a /me command to the channel, it simply sends a regular message with the word ACTION added to the front of it.

Expected behaviour: The action command should send the /me command to the channel with the message.

Error log: N/A

Insert your error log here

Server configuration

AlcaDesign commented 3 years ago

client.action is sending \u0001ACTION ${message}\u0001. Are you seeing "ACTION" rendered by the Twitch website or app with no third party extensions? How could I recreate this issue? Screenshots or something?

ghost commented 3 years ago

Yes, I'm seeing "ACTION" rendered on Twitch as well as the Streamlabs Chatbot. If it's working fine for you, I'm not sure how the issue could be recreated, but I was able to make it work by using this._sendCommand instead of this._sendMessage in commands.js:110. I used /me ${message} as the message parameter and removed the message transformation on line 107 that put the word "ACTION" into it.

RedEars commented 3 years ago

I've seen the same issue some times with client.say and could just replicate it. Seems to happen with longer messages. This happens if the text has line breaks. No third-party extensions installed.

This call does not work/prints ACTION in chat:

 client.say(
channel,
        `/me technosterone test: 1. the main cause of [explosions].
2. any thing [dreaded] that your "teachers" say is "good" for you. soon after, you explode for no reason.
3. what scientists do to make stuff explode.
4. when a sheet of paper explodes into [flames].. monkaThink Por ejemplo: 1. test [sodium] and water.
2. SAT is a test.
3. [Monkeys].
4. you brought your [lighter] to test.`
);

This call works:

client.say(
        channel,
        `/me technosterone test: 1. the main cause of [explosions]. 2. any thing [dreaded] that your "teachers" say is "good" for you. soon after, you explode for no reason. 3. what scientists do to make stuff explode. 4. when a sheet of paper explodes into [flames].. monkaThink Por ejemplo: 1. test [sodium] and water. 2. SAT is a test. 3. [Monkeys]. 4. you brought your [lighter] to test.`
);

So if variables/text inside of the call has line breaks, it does not work and prints out "ACTION"

Screenshots: screenshot-1614333884 screenshot-1614333909

(The define callback console log output is mine)