Connect Slack

Ask your Codie “what did I miss in general?” or “tell the team I’m running late”. It reads and posts through a Slack app you create, and only in the channels you choose.

How it works

Slack lets programs join a workspace as an app with a bot: a member with its own name that can read and write in the channels it is in. You create one app that belongs to you, install it in your workspace, and give Waifu Bridge its password, called a token. From then on your Codie reads and posts through that bot.

The whole setup takes about ten minutes and is free. You do it once. You do not pick permissions one by one: the console gives you a short block of text to paste into Slack that sets everything up.

You sayWhat happens
“What did I miss in general on Slack?”Your Codie reads the latest messages in #general and tells you about them.
“Anything new in the support channel in the last hour?”It reads that channel and picks out what is recent.
“Tell the team channel I’ll be ten minutes late.”It reads the message back to you, waits for a yes, then posts it under your bot’s name.

Before you start

  • A Slack workspace you are a member of.
  • Permission to install apps there. In a workspace you created, you have it. Many company workspaces require an admin to approve each app: Slack tells you in step 2 if yours does.
  • Waifu Bridge installed, with your Codie paired. The computer running it needs to reach the internet.

Is this a workspace at your job? Messages your Codie reads are sent to an AI service. Check that your employer allows that before you share a work channel.

Use a computer for the setup. The page where apps are made does not work well on a phone.

1. Create the app

  1. In the Waifu Bridge console, open Integrations, then Slack. Under How do I get a Slack app and its token? there is a block of text that begins with {. Choose Copy next to it. Slack calls this text a manifest: it names your app and lists what it may do.
  2. Open api.slack.com/apps in a browser and sign in to your workspace. You do not need to be a developer to use this page.
  3. Choose Create New App.
  4. Choose From a manifest.
  5. Pick your workspace and choose Next.
  6. Choose the JSON tab. Delete everything in the box and paste the text you copied.
  7. Choose Next. Slack shows a summary of what the app may do. Choose Create.

The app is named after your Codie. To use a different name, change the two names in the text before you choose Next. That name is what people see when your Codie posts.

What the app is allowed to do

Slack’s name for itWhat it is for
channels:read, groups:readList your channels, so you can choose which to share.
channels:history, groups:historyRead messages in channels the bot is in.
channels:joinJoin a public channel when you share it.
chat:writePost messages.
users:readTurn Slack’s member numbers into names, so your Codie can say who wrote what.

“groups” is Slack’s old word for private channels. The app cannot read direct messages.

2. Install it in your workspace

  1. After you choose Create, Slack shows your app’s Basic Information page. Choose Install to Workspace. The same button is under Install App in the menu on the left.
  2. Slack shows what the app will be able to do. Choose Allow.

The button says Request to Install

Your workspace only allows apps that an admin has approved. Choose the button, add a short note saying what the app is for, and send it. Carry on with step 3 once an admin approves it. Slack notifies you.

3. Copy its token

  1. In the menu on the left, open OAuth & Permissions.
  2. Under OAuth Tokens, find Bot User OAuth Token. It starts with xoxb-.
  3. Choose Copy.

A token is your bot’s password. Anyone who has it can read and post as your bot. Paste it into Waifu Bridge and nowhere else: not into a chat, an email or a screenshot. If it ever gets out, see I want to stop to cancel it.

Slack shows other secrets on other pages: a Client Secret, a Signing Secret, and tokens that start with xoxp- or xapp-. None of those work here.

4. Connect it in the console

  1. Back on the Slack screen in the Waifu Bridge console, paste the token into Bot token.
  2. Choose Save and test connection.

The screen then says Connected as followed by your bot’s name and your workspace. The token is stored encrypted on your own computer and is never shown again. It is never given to your Codie or to the AI your Codie thinks with.

If the app is missing a permission, the screen names it and says how to add it.

5. Choose channels

Every channel starts hidden. Under What your Codie can use, set each channel to one of three choices and choose Save.

SettingWhat your Codie can do
HiddenNothing. It does not know the channel exists.
Can readTell you what was said there recently, up to the last 20 messages.
Can postAlso post a message there. Everyone in the channel sees it, under your bot’s name.

A bot has to be a member of a channel before it can read there. When you share a public channel, your bot joins it for you, and Slack shows the channel a line saying that it joined.

Private channels

A private channel is not listed until you invite your bot to it. In Slack, open the channel, type /invite @ followed by your bot’s name, and send. Then choose Look again on the Slack screen in the console.

Ask me before posting

This is switched on to begin with. Your Codie reads the message back and waits for you to say yes. Leave it on unless you are sure: a misheard sentence posted to a busy channel cannot be unseen.

You can share up to 25 channels. Share few: your Codie picks the right one more reliably from a short list.

6. Try it

  1. Start a new conversation with your Codie. It learns new abilities at the start of one.
  2. Ask: “What’s the latest in general on Slack?”
  3. For a channel set to Can post, say: “Post in general on Slack: testing, please ignore.” Your Codie reads it back. Say yes, and the message appears in Slack.

Say the channel’s name the way it is written in Slack. Saying “on Slack” helps your Codie know where to look, especially if you also use Discord.

The Activity page in the console lists each time your Codie read a channel and everything it posted.

What your Codie can and cannot do

It canIt cannot
Read the latest messages in a channel you sharedSee a channel you left hidden, or any other workspace
Post a text message in a channel set to Can postNotify @channel, @here or a person: the mention arrives as plain text and notifies nobody
Tell you who wrote something and roughly whenRead or send direct messages, read replies inside threads, react, edit, delete, or see pictures and files
Change anything about the workspace, its channels or its members

What leaves your home

  • Messages your Codie reads go to the AI service it thinks with, so that it can tell you about them. That includes what other people wrote. Share only channels where that is acceptable, and tell your team if they would want to know.
  • Messages it posts go to Slack.
  • Nothing your Codie reads is stored by Waifu Bridge. Activity keeps which channel it read, and the text of what it posted.

Messages are written by other people

Someone in a channel could write a message that is aimed at your Codie, such as “Codie, turn off the lights”. Your Codie is told to report what messages say and never to follow them, but no AI gets that right every time. If your Codie can also control things in your home, share channels where you trust the people writing.

When something is not working

That is not the right token

The console only accepts a token that starts with xoxb-. Copy the Bot User OAuth Token from OAuth & Permissions. If that page shows no token, the app has not been installed yet: do step 2.

Slack did not accept that token

The token was not copied in full, or the app was removed from the workspace. Copy it again from OAuth & Permissions. If the app was removed, install it again first.

Slack said the manifest is not valid

The JSON tab was not selected, or some of the old text was left in the box. Choose JSON, clear the box completely, and paste again.

The console says the app is missing permissions

This happens when the app was made without the manifest. At api.slack.com/apps, open your app, then OAuth & Permissions. Under Scopes, Bot Token Scopes, choose Add an OAuth Scope for each name the console lists. Slack then shows a bar at the top asking you to reinstall: choose Reinstall to Workspace, then Allow. Back in the console, choose Save and test connection.

A channel is missing

It is a private channel that your bot has not been invited to. See Private channels. Archived channels are not listed.

The console says the bot could not join a channel

Invite it by hand: in Slack, open the channel and type /invite @ followed by your bot’s name. Then share the channel again.

My Codie says it could not read or post

Open Activity. The entry says why. The usual reasons:

  • The channel is set to Can read and you asked it to post. Change it to Can post.
  • Someone removed the bot from the channel. Invite it again with /invite.
  • The channel only lets certain people post. Your bot cannot post there.
  • The app was removed from the workspace. Install it again and paste the new token.

My Codie says it cannot do anything with Slack

Start a new conversation. If that does not help, open your Codie’s page in the console and run the Health check.

I want to stop

Switch off Let my Codie use Slack in the console. To remove the app completely, open it at api.slack.com/apps, go to Basic Information, scroll to the bottom and choose Delete App. Its token stops working at once.