Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slack: is there a way to disable all @channel notifications

The Slack chat tool by default sends email notifications saying "You were mentioned ..." when in fact it was @channel and not you. The only way I can find to turn these off is to go into each channel setting.

like image 753
Dave Crooke Avatar asked Sep 04 '15 15:09

Dave Crooke


People also ask

Is there a way to mute @channel on Slack?

Open the channel that you want to mute. Click on the channel name in the conversation header. Below the channel name, click on the notifications menu. Select Mute channel.

How do I turn off notifications for certain Slack channels?

Open a channel or group DM. Click the channel or member names in the conversation header. Below the conversation name, click the notifications drop-down menu. Choose your notification preference.

How do I mute all Slack sounds?

From your desktop, click your profile picture in the top right. Select Preferences from the menu to open your notification preferences. Scroll down to Sound & appearance. If you'd like, check the box next to Include a preview of the message in each notification or Mute all sounds from Slack.

Can you turn off notifications for a specific person Slack?

Configure conversation-specific notificationsClick on the channel or member names in the conversation header. Below the conversation name, click on the notifications drop-down menu. Choose your notification preference. Click on the close icon in the top right when you've finished.


Video Answer


2 Answers

I was looking for the same and I saw that nobody answered, so this is what I've found: you cannot and you won't ever be able to.

@channel: everybody in a channel, it's a kind of contract with the user and everybody inside a channel should receive a notification.

The point is that Slack has a netiquette, and users would have to know it. Alternatives to @channel keyword are @everyone and @here, the first one working only in "big" channels, the second one only for people currently active. You can disable notifications for these keywords.

https://get.slack.help/hc/en-us/articles/202009646-Make-an-announcement

enter image description here

like image 168
Mauro Piccotti Avatar answered Oct 16 '22 23:10

Mauro Piccotti


I've had this same problem for a while and manually tweaking prefs is too time-consuming. I've written a script to automate it for me.

For a more in-depth explanation, please visit my blog post:
https://mobeigi.com/blog/programming/disable-slack-channel-and-here-notification-for-all-channels/

Otherwise, the full solution ahead.

Prerequisites

First download this script:
https://gist.github.com/mobeigi/8e5372f1e14e2a302e186d1753f9a649

Or copy and paste it from here:

// Slack User Notification Preference Bulk Update // By Mo Beigi  const slackTeamId = "EXAMPLE17"; const localConfigJson = JSON.parse(localStorage.localConfig_v2); const slackUrl = localConfigJson.teams[slackTeamId].url; let channel_ids = [];  // client.boot contains list of channel ids user is subscribed to amongst other things await fetch(slackUrl + "api/client.boot?" +     "_x_id=noversion-1598950616.732" +     "&_x_version_ts=noversion" +      "&_x_gantry=true",    {     method: 'post',     credentials: 'include',     headers: { "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" },     body: "token=" + localConfigJson.teams[slackTeamId].token +          "&only_self_subteams=1" +          "&flannel_api_ver=4" +          "&include_min_version_bump_check=1" +          "&version_ts=1598934919" +          "&_x_reason=deferred-data" +          "&_x_sonic=true",   }, ) .then(result => result.json()) .then(result => channel_ids = result.channels);  // iterate channel id list and set notification prefs asynchronously let fetchPromises = []; for (i = 0; i < channel_ids.length; ++i) {     console.log("Setting user notification prefs for channel id: " + channel_ids[i].id + " ...");     fetchPromises.push(         fetch(slackUrl + "api/users.prefs.setNotifications?" +             "_x_id=c189c956-1598949859.880" +              "&_x_csid=7dP2GCgBJsY" +              "&slack_route=" + localConfigJson.teams[slackTeamId].enterprise_id + ":" + slackTeamId +             "&_x_version_ts=1598934919" +              "&_x_gantry=true",              {                 method: 'post',                 credentials: 'include',                 headers: { "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" },                 body: "name=suppress_at_channel" +                     "&value=true" +                      "&channel_id=" + channel_ids[i].id +                     "&global=false" +                      "&sync=false" +                     "&token=" + localConfigJson.teams[slackTeamId].token +                     "&_x_reason=prefs-store/setChannelNotificationOverride" +                     "&_x_mode=online" +                     "&_x_sonic=true"             }         )         .then(result => result.json())         .then(console.log("Done (" + channel_ids[i].id + ")"))     );      // Generous delay to get around rate limit     await new Promise(r => setTimeout(r, 250)); }  Promise.all(fetchPromises).then(function() {     console.log("Successfully set user notification prefs for " + channel_ids.length + " channels."); }); 

Steps

  1. Visit the React web app which powers the React native Slack client at: http://app.slack.com/client
  2. Sign in and switch to the workspace of interest and wait for the page to fully load.
  3. Open your browsers developer console
  4. Execute the following line: JSON.parse(localStorage.localConfig_v2).teams
  5. Replace the slackTeamId in the Javascript script with your id from Step 4.
  6. Copy and paste the edited Javascript script into the developer console and execute it. The script may take a few minutes to run depending on the number of channels you have joined.

And that's it!

You should now have turned every channels @channel and @here notification preference off.

slack_user_noti_pref_bulk_update.js script execution

like image 20
Mo Beigi Avatar answered Oct 17 '22 00:10

Mo Beigi