Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bot no longer starts #44

Open
pmauduit opened this issue Sep 28, 2022 · 5 comments
Open

bot no longer starts #44

pmauduit opened this issue Sep 28, 2022 · 5 comments

Comments

@pmauduit
Copy link
Owner

this is due to the slack API deprecation here:
https://api.slack.com/changelog/2021-10-rtm-start-to-stop

and the client lib i am using has not been updated:
Itiviti/simple-slack-api#289

I guess I'll have to get back onto IRC ...

@pmauduit
Copy link
Owner Author

Tried with a more recent version, but either I missed something when installing by hand the jar in my local repo, or something else, but I am still facing a NPE at bot's startup.

@pmauduit
Copy link
Owner Author

pmauduit commented Sep 28, 2022

Things are becoming quite complicated, I had to:

  1. upgrade my app so that I'm using the new scopes (my app was created in a former deprecated fashion ...)
  2. select a reasonable amount of scopes, but avoiding the ones that requires a workspace admin to set the app up into my organization, because I'm not admin and won't be able to use it anymore
  3. generate an app token, along with the connection:write scope
  4. use a compiled version of ullink's slack api from master (provided one on maven central is not recent enough)
  5. pass the app token when connecting, as 2nd arg

There are still some issues:

  1. the message posted listeners are not working anymore, meaning that all the commands that I was able to send to my bot are still broken
  2. the bot keeps disconnecting / reconnecting to slack at a regular interval.

But at least, if I can get back the notifications the bot used to send me, I'd be quite happy ...

@pmauduit
Copy link
Owner Author

  1. the message posted listeners are not working anymore, meaning that all the commands that I was able to send to my bot are still broken

I found out why in the slack api manager clickodrome. I have to activate the bot events and subscribe to the bot events:

image

Bad news is that the JSON being sent evolved and the client lib does not recognize it anymore:
https://github.com/Itiviti/simple-slack-api/blob/master/sources/src/main/java/com/ullink/slack/simpleslackapi/impl/SlackWebSocketSessionImpl.java#L317

I might have a chance with the fork from the guy who fixed the lib.

  1. the bot keeps disconnecting / reconnecting to slack at a regular interval.

the ping/pong API does not seem to exist anymore, I just removed the test which checks if last pong received matches the last ping sent.

@pmauduit
Copy link
Owner Author

pmauduit commented Sep 28, 2022

There are too many bugs to fix in simple-slack-api to have it working again following the api changes, I am considering switching to https://github.com/slackapi/java-slack-sdk :'(
e.g. the events being received via the websocket are not acknowledged, so slack sends them 5 times. As a result, each commands sent to the bot are sent back to the user 5 times ...

@pmauduit
Copy link
Owner Author

pmauduit commented Sep 28, 2022

okay, I gave a try to the official slack java API, and it was quite straightforward to use, I guess I'll drop com.ullink.simple-slack-api in favor of the official one.
I just hope I can send the same messages as the ones I'm formatting from my bot code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant