Slack-Twitter icon indicating copy to clipboard operation
Slack-Twitter copied to clipboard

Unable to Auto-Tweet Slack Messages Posted by Bots

Open buck-0x opened this issue 9 years ago • 14 comments

I have had no luck trying to modify things so that bot messages posted to the channel are tweeted.

I tried removing the message.subtype != 'bot_message' line from the code below to no avail.

if (message.channel == the_channel.id && (message.subtype != 'message_changed' && message.subtype != 'bot_message' && message.subtype != 'channel_join')) {

buck-0x avatar Jul 08 '15 06:07 buck-0x

That sounds like a feature request, that is, to make bot tweets a setting rather than hard-coded. That's partly a remnant of (originally) having a single channel for posting & reading. Otherwise, timeline tweets would get RTed, hilariously. A heisenbug forced me to work around it by splitting it up into two channels.

What's your use case? I'm just curious, since it sounds like this is something I can add.

sillygwailo avatar Jul 08 '15 20:07 sillygwailo

I want to tweet VCS commits and other automated development notifications integrated with Slack for an open development thing.

Regards, Bradley Weiers (Sent from mobile device)

On Jul 8, 2015, at 4:40 PM, Richard Eriksson [email protected] wrote:

That sounds like a feature request, that is, to make bot tweets a setting rather than hard-coded. That's partly a remnant of (originally) having a single channel for posting & reading. Otherwise, timeline tweets would get RTed, hilariously. A heisenbug forced me to work around it by splitting it up into two channels.

What's your use case? I'm just curious, since it sounds like this is something I can add.

— Reply to this email directly or view it on GitHub.

buck-0x avatar Jul 09 '15 01:07 buck-0x

Is this for an integration?

The bot messages I'm able to do a console.log on, the message.subtype property is undefined. That never felt right to me, since I expected it to have "bot_message" as a value. https://api.slack.com/events/message/bot_message

I'll see if I can pull together some tests to make a support call to Slack's API team.

sillygwailo avatar Jul 09 '15 03:07 sillygwailo

I'm not building a new integration. Just using Slack's existing integrations to automate tweets for certain events related to development progress on software so that our users and testers can stay in the loop with Twitter. This seemed like a really fast way to do it at the beginning.

On Wed, Jul 8, 2015 at 11:41 PM, Richard Eriksson [email protected] wrote:

Is this for an integration?

The bot messages I'm able to do a console.log on, the message.subtype property is undefined. That never felt right to me, since I expected it to have "bot_message" as a value. https://api.slack.com/events/message/bot_message

I'll see if I can pull together some tests to make a support call to Slack's API team.

— Reply to this email directly or view it on GitHub https://github.com/sillygwailo/Slack-Twitter/issues/15#issuecomment-119805039 .

Regards,

Bradley Weiers

buck-0x avatar Jul 09 '15 05:07 buck-0x

Yeah, existing integration is what I meant. I'll see what I can figure out.

sillygwailo avatar Jul 09 '15 05:07 sillygwailo

Perhaps it's because the current solution uses a 'Bot' instead of a 'Slackbot'?

On Thu, Jul 9, 2015 at 1:50 AM, Richard Eriksson [email protected] wrote:

Yeah, existing integration is what I meant. I'll see what I can figure out.

— Reply to this email directly or view it on GitHub https://github.com/sillygwailo/Slack-Twitter/issues/15#issuecomment-119828247 .

Regards,

Bradley Weiers

buck-0x avatar Jul 09 '15 17:07 buck-0x

Any word from the Slack guys?

buck-0x avatar Jul 15 '15 05:07 buck-0x

I just sent a support request to them asking how to tell if a message was posted by a bot integration. I did just get a 'bot_message' but that was from Slackbot. I never get it from any of my own integrations that are bot integrations.

sillygwailo avatar Jul 22 '15 20:07 sillygwailo

Any response from them?

On Wed, Jul 22, 2015 at 4:37 PM, Richard Eriksson [email protected] wrote:

I just sent a support request to them asking how to tell if a message was posted by a bot integration. I did just get a 'bot_message' but that was from Slackbot. I never get it from any of my own integrations that are bot integrations.

— Reply to this email directly or view it on GitHub https://github.com/sillygwailo/Slack-Twitter/issues/15#issuecomment-123854746 .

Regards,

Bradley Weiers

buck-0x avatar Jul 26 '15 18:07 buck-0x

Yup, they asked if it was using the as_user flag, and I don't believe it is. When I hear more, I'll post it here.

sillygwailo avatar Jul 26 '15 20:07 sillygwailo

It sounds like bot users have IDs that start with the letter B, so that's what I'll key on when messages come through. When I can steal a moment, that's how I'll implement it.

sillygwailo avatar Jul 30 '15 02:07 sillygwailo

If you can give me a hint on where (i.e. which files) to get started perhaps I can spend some time on it.

buck-0x avatar Aug 06 '15 18:08 buck-0x

I pushed the initial work I did, based on the information I got in the support request from Slack, to a branch called is_bot-check. I haven't tested it much, and don't know if I got the ALLOW_INTEGRATIONS flag check right. If you want to try that out, I'd be interested to know if that works the way you'd expected it to.

sillygwailo avatar Aug 06 '15 18:08 sillygwailo

Ok, but on the current release Nuzzel can’t post through twitter, though it was doing so in the previous release.

jaredbidlow avatar Jan 09 '18 00:01 jaredbidlow