fraschetti / Octoslack

OctoPrint plugin for Slack, Mattermost, Pushbullet, Pushover, Rocket.Chat, Discord, Riot/Matrix, & Microsoft Teams
MIT License
74 stars 34 forks source link

[Feature Request] Print User who started the print #66

Closed JFSolution closed 4 years ago

JFSolution commented 4 years ago

show the user who startet the print in the slack message and maybe send the messages only to the user who startet the print

fraschetti commented 4 years ago

@JFSolution

Which user are you interested to expose?

  1. The Slack user who started a print via a command issued from Slack
  2. The OctoPrint user who started the print via the OctoPrint UI
fraschetti commented 4 years ago

As for sending messages only to the user who started the print. For Slack, it's easiest to use a dedicated channel. I've gone down the DM path for Slack before and it unfortunately ended in failure. The plugin can do this in other chat platforms but Slack itself has some limitations that I previously hit.

nebbles commented 4 years ago

I've never used option 1 above, but I assume that when initiated from Slack, it will be linked via a specific account in Octoprint.

I would recommend using the Ocotoprint user as described in the UI. It's relatively trivial (as we have done in current start-up) of giving people each their own Octoprint account. That way we could clearly see who's print is currently running (whether in the Octoprint UI or, hopefully 🤞, in the Slack status updates).

JFSolution commented 4 years ago

The octoprint user which started the print. I made a fork and added the feature. https://github.com/JFSolution/Octoslack To post only to the user who started the print. There should be a way to associate the slack- with the octoprint-user.

fraschetti commented 4 years ago

Hi @JFSolution

I used your changes as the base of what I eventually ended up integrating into Octoslack. I've made an attempt in the just relased Octoslack 2.0.0 to satisfy both camps - those who want to see the OctoPrint username and those who want to see the Slack username.

The plugin will include these values where it makes sense (e.g. list the Slack username of the user who cancelled a print via Slack) but they're also available via the new {octoprint_user} and {slack_user} message variables.

FYI @nebbles ^^

Please let me know if these new changes don't satisfy your needs.