(enter) in !twitter post command to be replaced with carriage return

[Migrated to Feature Request by IllusionaryOne - please support (enter) tag in !twitter post]

Hello,

I am trying to send a tweet with carriage returns from twitch chat. From a previous posts on this forum it would seem that i should use the actual string value of β€œ(enter)” and the bot will replace that with a carriage return. but this is not working for me, maybe i misunderstood.

I issue a command from Twitch chat like this:

!twitter post line 1 (enter) line 2 (enter) line 3

The tweet that appears is exactly like that:

line 1 (enter) line 2 (enter) line 3

How can i issue a tweet from Twitch chat and have it include carriage returns like this?

line 1
line 2
line 3

Tested from the 3.0.0 PhantomBot release:

image

Text for the message:
Testing Online(enter)Please ignore this, will be(enter)deleted shortly.

While the spaces shouldn’t matter, I never use them. However, (enter) I believe is reserved only for alert messages to Twitter, not for posts. Like Scania indicated, automated Tweets. You can open a feature request to support (enter) on !twitter post or modify the Twitter module by copying/pasting the code from elsewhere in the module to support that tag.

I had already took a look in twitter handler js file and noticed the regex locating and replacing the (enter) in the live notification alerts, but i couldnt find the entrypoint for the β€˜!twitter post’ command to check or modify.

I suppose i could post a feature request, but there already is one here:

That feature request was met:

Could we please get the ability to customise the tweet when yo[u] go live 

You can do that, this sounds like a slightly different request to do it on posts. I will just migrate this to a Feature Request to get the upvotes :slight_smile:

Implementing this was much easier then i expected;

I modified line 438 of TwitterHandler.js from this:

var retval = $.twitter.updateStatus(args.splice(1).join(' ')) + '';

To this:

var retval = $.twitter.updateStatus(String(args.splice(1).join(' ')).replace(/\(enter\)/g, '\r\n')) + '';

Making that change above allows the (enter) to be used with the β€˜!twitter post’ command.

Will you submit a patch or may I copy/paste and test in my bot giving you credit?

1 Like
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.