tmi.js icon indicating copy to clipboard operation
tmi.js copied to clipboard

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

Open ghost opened this issue 5 years ago • 3 comments

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

  • Operating system: Windows 10
  • Node version (if applicable):
  • NPM version (if applicable):
  • tmi.js version: 1.5.0

ghost avatar Sep 23 '20 19:09 ghost

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?

AlcaDesign avatar Sep 24 '20 02:09 AlcaDesign

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.

ghost avatar Sep 24 '20 20:09 ghost

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)

RedEars avatar Feb 26 '21 10:02 RedEars