53

Bots cannot use the regular channels.leave API call, so how do I make a bot leave a channel, short of kicking it? I need it to leave a channel where I do not have rights to kick users.

Ivan Aracki
  • 4,861
  • 11
  • 59
  • 73
talloaktrees
  • 3,508
  • 6
  • 28
  • 43

2 Answers2

57

You can /remove (or /kick) the bot. Type /kick @botname in the channel which you want the bot to leave.

guillaume.deslandes
  • 1,191
  • 9
  • 12
  • 21
    for public channels, only team owners and admins can use the remove action. All other get `Removing from channels is a restricted action` – bscan Jul 11 '16 at 16:02
  • 8
    FYI, I'm guessing you cannot remove @slackbot from a channel. The command `/kick @slackbot` does not work, because it says @slackbot is not a member of the channel. – Chadwick Meyer Apr 10 '17 at 15:56
  • 4
    It isn't possible: *@slackbot* is not a member of this private channel. – Denis V May 25 '17 at 14:43
  • 1
    The question specifically said they don't have the rights to kick users, so this answer isn't exactly that helpful... except to Googlers who do have those rights, I suppose! – Tim Malone Aug 09 '18 at 14:17
  • 1
    We made a Slack integration that handles this very problem (It auto deletes all Slackbot responses as it can't be kicked): https://github.com/UnitedIncome/slackbot-destroyer – James Ives Nov 08 '18 at 17:10
4

If you are asking about Slackbot in particular, you cannot remove it from a channel (see Slack's response to this question).

If you have permission to delete Slackbot's responses, you can install this bot, which will delete Slackbot's automated responses for you.

meggie
  • 41
  • 1