stephenyeargin / hubot-grafana

📈🤖 Query Grafana dashboards
http://docs.grafana.org/tutorials/hubot_howto/
MIT License
154 stars 48 forks source link

Support for @hubot-friends/hubot-slack #156

Closed KeesCBakker closed 1 year ago

KeesCBakker commented 1 year ago

Is your feature request related to a problem? Please describe.

Currently the most common adapter for Slack is hubot-slack (https://github.com/slackapi/hubot-slack). Unfortunately it is no longer maintained and will not be upgraded. Fortunately somebody is working on a modernized fork that uses socket mode (https://www.npmjs.com/package/@hubot-friends/hubot-slack and https://github.com/hubot-friends/hubot-slack).

I'm testing the new adapter and it works like a charm. The robot.adapterName for this package is @hubot-friends/hubot-slack. It would be great if we could make it work with hubot-grafana.

Describe the solution you'd like I think the change is easy, as on line 78 it could read:

 } if (robot.adapterName === 'slack' || robot.adapterName === '@hubot-friends/hubot-slack') {

And line 474+475 could be changed into:

      // Slack
      case 'slack':
      case '@hubot-friends/hubot-slack':

Describe alternatives you've considered I don't think an alternative is applicable as the package is so tightly coupled on the name slack.

Additional context The main Hubot packages was also patched to accommodate these types of adapters: https://github.com/hubotio/hubot/commit/ac5dcd2f550e07dce4637ba0aa3fc0dab7050e6a and https://github.com/hubotio/hubot/pull/1655