gpt4 book ai didi

notifications - Slack:有没有办法禁用所有@channel 通知

转载 作者:行者123 更新时间:2023-12-03 11:02:40 25 4
gpt4 key购买 nike

默认情况下,Slack 聊天工具会发送电子邮件通知说“你被提及...”,而实际上它是 。 @ channel 而不是你。我能找到关闭这些的唯一方法是进入每个 channel 设置。

最佳答案

我已经有一段时间遇到同样的问题了,手动调整首选项太费时了。
我已经编写了一个脚本来为我自动化它。
更深入的解释,请访问我的博文:
https://mobeigi.com/blog/programming/disable-slack-channel-and-here-notification-for-all-channels/
否则,前面的完整解决方案。
先决条件
首先下载这个脚本:
https://gist.github.com/mobeigi/8e5372f1e14e2a302e186d1753f9a649
或者从这里复制并粘贴它:

// 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.");
});
脚步
  • 访问为 React 原生 Slack 客户端提供支持的 React Web 应用程序:
    http://app.slack.com/client
  • 登录并切换到感兴趣的工作区并等待页面完全加载。
  • 打开浏览器开发者控制台
  • 执行以下行:JSON.parse(localStorage.localConfig_v2).teams
  • 替换 slackTeamId在 Javascript 脚本中使用您在第 4 步中的 id。
  • 将编辑后的 ​​Javascript 脚本复制并粘贴到开发人员控制台中并执行它。
    该脚本可能需要几分钟才能运行,具体取决于您加入的 channel 数量。

  • 就是这样!
    您现在应该已经打开了所有 channel @ channel @这里 通知首选项关闭。
    slack_user_noti_pref_bulk_update.js script execution

    关于notifications - Slack:有没有办法禁用所有@channel 通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32401233/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com