hook up discord
set up the one discord bot every project shares, tell smith where its token comes from, bind a project to a server, and check the connection from the discord page.
smith's discord bridge puts gates, launch cards and proposals in a channel and takes your presses there. it's one bot that serves every project that binds a server of its own. the docs don't cover making the bot in discord's own settings, so this guide starts from a bot you already have.
01the desk side#
the desk.json block discord is the one bot every bound project shares, and its operator. it holds no token. the keys are on discord:
operatoris a discord user id, and it's the one operator whose presses count. without it the feature is off. see operator.token_envnames the env var the bot token is read from. it defaults toSMITH_DISCORD_BOT_TOKEN. see token_env, and environment variables for the variable.token_fileis a file the token is read from when the env var is empty. see token_file.chatis the chat your direct messages talk to. see chat.enabledis the master switch of the discord session. absent means on. see enabled.
the token is read in this order. with no discord block, or an empty operator, the feature is off and the reason says which. otherwise the variable named by token_env is read, and a non-empty value wins. failing that, token_file is read and its trailing line breaks are trimmed. an unset, unreadable or empty file leaves the feature off. the reason text never contains the token. that's all under the token and desk.json.
02bind a project to a server#
a project's discord block is in its local half, so it's machine-local. see two halves. the conductor can't write it directly: it drafts the change with propose_config_edit and you click. the fields are:
on: the project's box. off means nothing from it posts, and its server is treated as unbound. it defaults to off.guild: the server's id, digits only.free_chat: lets a plain message in a mapped channel reach its chat. off, a plain message is ignored, and commands and buttons work either way.gate_cards: posts the project's gate cards to discord. it defaults to off.channels: maps a channel id to the desk chat it is.audience: who reads the server's channel chats,operator(the default) ormates, people who aren't technical.members: people of the server who may act, each with aresearchand areadright.
the full list, with the slash commands /research, /status and /tickets, is under a project binds a server. audiences and members have their own sections, audiences and members.
03check it#
each project with its box on gets a discord page. a bound server has six checks there: bot token, bot in server, message content, server members, commands and posting. each is ok, fail, warn or not run, with what it found and how to fix a failure. the message content and server members intents are privileged, and you set them in the discord developer portal. posting is only tested when you press test. see the discord page.
the conductor's discord_state tool says in plain words whether the bridge is on, on with cards only, off, missing a token, or not set up. a press from discord is the same press as in the window, and the thread says "(from discord)". see one bot.
04switching it on and off#
the bridge is switched with a propose_discord card, and you click it. it needs chat to switch on when none is set. see the cards.
05where to go next#
discord has the whole page, desk.json every key, and environment variables the token variable.