42

Is it possible to invite all users (the entire team) to a new Slack channel? It seems there are limits to the number of people that can be invited at once.

  • Related. (Possible duplicate?) Invite multiple Slack users to a channel – ale Dec 2 '16 at 19:04
  • Yeah, that is related but not really a duplicate. That question does not provide a solution to my problem. – Abram Dec 2 '16 at 19:08
  • 1
    If you are using a multi-workspace solution (Slack Enterprise Grid) your user list may include people outside your workspace. If your #channel is workspace-specific, these solutions potentially add ALL users to the channel. – Choovermonium Mar 5 '18 at 17:09
3

This is finally possible with /invite @listname – when you type /invite @ auto suggest will give you more options than via the "invite people" link.

42

Since @Abram solution stopped working I played a little bit. This one works partially for me now, you might need to run it a couple times though

His instructions: Just browse to the appropriate channel and paste this script (below) into your Chrome/Firefox dev console and hit enter. Then wait for the script to run until it completes. It might take time as there is a limit to how many users may be invited at once. The script will loop until all team members are invited.

var foundAny=false;
function selectAllByLetter(remainingLetters) {
  console.log(remainingLetters)
  var letter = remainingLetters.pop();
  $("#channel_invite_filter").val(letter).trigger("input");
  setTimeout(function() {
    $(".channel_invite_member:not(hidden)").each(function(i, obj) {
        foundAny=true;
        this.click();
    });
    if (remainingLetters.length) {
      selectAllByLetter(remainingLetters);
    } else {
      setTimeout(function() {
        console.log("Inviting them all!")
        $('.invite_go').click()
      },400)     
    }
  },300);
}

function inviteAllUsers() {      
  foundAny=false;     
  setTimeout(function () {    
      setTimeout(function() {
        $('#channel_actions_toggle').click();
      },100)
      setTimeout(function() {
        $('#channel_invite_item').click();
      },200)
      //Enter each letter to trigger searches
      var remainingLetters = ["a","b","c","d","e","f","g","h","i","j","v","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];
      selectAllByLetter(remainingLetters);
      if (foundAny) {
        inviteAllUsers();
      }
   }, 4000);
}
inviteAllUsers();  
  • 1
    Works like a charm, thanks! – Pwdr Mar 14 '17 at 10:58
  • 2
    Thanks for providing a working answer. I will remove mine since it has stopped working. – Abram Mar 21 '17 at 3:07
  • 1
    Care, this also invite bots in channel – Tib Nov 3 '17 at 13:14
  • Yes it does. Also, for some reason with big groups you need to run it twice – John Alexis Guerra Gómez Apr 11 '18 at 23:42
20

Found a more straightforward solution. No script, no extensions:

  1. Type the /who command on a channel where you have the (most) people you want to add.
  2. Copy the output
  3. Paste it in the channel where you want those people to get invited to
  4. Press Intro/Enter key

Slack will ask you what to do with all those people "that are not in the channel yet". If you press the Invite button you'll get everybody invited

  • I didn't actually test this answer, but assuming it works, it should be marked the correct solution. I have assigned this as the solution, but would appreciate confirmation from others that the solution works. Thanks! – Abram Dec 27 '18 at 21:12
  • It worked for me. It did put a post in the new channel with everyone's @ in it. But that's fine by me. – davepreston Mar 6 at 23:13
  • 1
    This is however limited to show the first 99 members of the channel (which you can copy/paste). – Jan Mar 18 at 10:56
4

Wrote a script that also does the same thing.

Steps:
1. Go to channel page
2. Copy/paste code into browser console

All users will be added.

//////////////////////////////
// AFTER.JS Module
//////////////////////////////

var After = function () {
    this._totalTime = 0;
};

// It's prototype
var protoAfter = {
    // After (time) seconds, run a handler
    after: function (time, handler) {
        this._totalTime += time;

        setTimeout(function () {
            handler();
        }, this._totalTime * 1000);

        return this;
    }
};

$.extend(After.prototype, protoAfter);

//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ End of After section

var first = "a",
    last = "z";

var after = new After();
after.charIndex = first.charCodeAt(0);

for (var i = first.charCodeAt(0); i <= last.charCodeAt(0); i++) {

    after
        .after(0.3, function () {
            $('#channel_actions_toggle').click();
        })

        .after(0.3, function () {
            $('#channel_invite_item').click();
        })

        .after(0.3, function () {
            $("#channel_invite_filter").focus();
            $("#channel_invite_filter").val(String.fromCharCode(after.charIndex)); // type in character
            $("#channel_invite_filter").trigger("input");
            after.charIndex++;
        })

        .after(0.5, function () {
            $(".add_icon").click();
        })

        .after(0.5, function () {
            $(".invite_go").click();
        })

        .after(0.5, function () {
            $("#fs_modal_close_btn").click();
        })
}
0

If you're not a programmer, there is a chrome extension that will do the job. https://chrome.google.com/webstore/detail/slack-invite-all/okakcmghmbmdgbccjfclfkeednhhlpeg

  • This is $1.99 a month. Absolutely ridiculous. – A.B. Carroll May 30 '18 at 3:07

protected by Community Mar 5 '18 at 23:46

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.