App No Longer Auto-Changes Status
Sometime last week, this app stopped working as expected. Last week I updated to version 1.0.9, and that's when I noticed the app stop functioning, though I'm not convinced it has to do with that update.
Looking at the logs, I see no errors, though I have noticed I also no longer see these types of messages:
02:11:22s 616ms [Info] [SlackPresence] Presence change: U02MG0PTR away
02:11:23s 027ms [Info] [SlackPresence] Setting myself active
02:11:24s 618ms [Info] [SlackPresence] Presence change: U02MG0PTR active
Incidentally, there is also a site www.slackpresence.com that provides the same functionality, and also appears to not work as expected. Could it be that Slack changed their API in some regard? Thanks for the help with this.
I see this application uses set active, actually you can check it yourself around line 93 [https://github.com/eskerda/slack-keep-presence/blob/master/index.js]
As you can read from Slack; this method is no longer offered: "The Slack messaging server no longer offers this functionality and this method now performs no operation." https://api.slack.com/methods/users.setActive
In other words, slack-keep-presence application is no longer useful hence it should be deprecated
I have done similar work with the existing source, but in the process disabled this utility's other functionality (away messages and such). I mention in case anyone is interested, though jumping to @joshfng's ruby rework would likely make more sense.
@zjr if you've got a simpler js version of this running via node, that'd be cool to see.
Hey gentlemen, just discovering this tool, is there any news on what the best solution is today? Should I install @joshfng 's version? I could take a crack at making a node version, I've been messing with node stuff a lot.
No guarantees on this but here's an update from what I eventually worked out for this: https://github.com/zjr/slack-keep-presence.
Slack's API didn't seem to allow setting status anymore so this very naively just reconnects to set as active.
It's very quick and very dirty and definitely ham-fisted but it might work or provide you with a basis.
Nice. I'll grab that, thanks!
To anyone I know who sees me commenting here, I only want to use Franz without getting auto-away whenever I spend longer than 30 minutes in my code editor!
@zjr Nice work on the update, it works if you supply the token directly (though it seems to default to --debug, as it logs all messages). Odd thing is that it appears it can't read a config file. Running slack-keep-presence doesn't appear to read a conf file in $HOME/.config/slack-keep-presence, nor does slack-keep-presence -c $HOME/.config/slack-keep-presence/conf. Always gives the response:
No such file: [redacted]/.config/slack-keep-presence/conf
@BigPrimeNumbers I would be willing to accept PRs for my fork of this but I don't really have the time to maintain this package. I only did this for me and I'm sharing in case it's useful for anyone else.
For those who can't make this or another solution work, I just made this simple program, the only thing that it does is to move the mouse cursor if it detects that you are away, tricking any program to think that you are still working on your computer:
Install it with snap:
sudo snap install keep-presence
More info here: https://github.com/carrot69/keep-presence/
Simple python script to achieve this goal: https://github.com/atif93/slack-keep-presence