Pillar

API

What you can put in a theme or a plugin, with an example of each.

Which file do I need?

To change coloursA theme file.
Anything elseA plugin, written in PSL.

Theme file

One file, themes/harbour.json. Every line here is required except description.

{
  "id": "harbour",
  "name": "Harbour",
  "description": "Blue-grey, easy on the eyes.",
  "version": "1.0.0",
  "authors": ["Your name"],
  "palette": {
    "bg": "#16212b",
    "secondary": "#121b24",
    "tertiary": "#0d141b",
    "floating": "#1f2d3a",
    "raised": "#1f2d3a",
    "text": "#e3ecf2",
    "muted": "#8fa3b3",
    "accent": "#5fb3c9",
    "link": "#8fc7ff",
    "border": "#2a3b4a"
  }
}
  • id must be the same as the file name.
  • version can be anything. Change it when you change a colour, so phones know to update.
  • Colours are written #rrggbb. What each of the ten is used for is in the guide.

A picture behind the chat

"background": {
  "url": "https://example.com/harbour.jpg",
  "blur": 6,
  "dim": 0.5
}

Optional; add it beside palette. url must start with https://. blur goes from 0 (sharp) to 20. dim goes from 0 to 0.9 and is how much of your bg colour is laid over the picture so messages stay readable. Shows on iPhone.

Plugin
PSL

Plugins are written in PSL, the Pillar Smart Language: a list of plain lines that can only name what's in the PCC. Pillar reads every line, checks it, and carries it out. A plugin never runs code of its own, so it can't reach the internet, your account or anything else Pillar doesn't allow.

One file, member-count.psl:

# Lines starting with # are notes for people.
plugin "Member Count"
about "Shows a server's online and total member counts next to its name."
version 2.0.0
by "Your name"

choice show "Next to the server name"
option show "both" "Online and members" default
option show "off" "Off"

switch chatHeader "Discord's member count in the chat header" on
describe chatHeader "Turns on Discord's own count under the channel name"

show chat-header-member-count if $chatHeader
add "  ·  {server.online} online / {server.members}" after {server.name} if $show is "both"

About the plugin

plugin "Name"Its name. Required.
about "…"One or two sentences, shown in the store.
version 1.0.0Required. Raise it when you change the plugin, so devices update.
by "Name"Credit. Required; repeat for several authors.
note "…"Something worth knowing, shown on its page.

Settings

switch key "Label" onA switch, on or off to start with.
choice key "Label"A list to pick from. Add its options below it.
option key value "Label" defaultOne option of a choice. The value is "text" or a number. Mark one default.
button key "Label"A button. Say what it does with on key do ….
describe key "…"A line of explanation under a setting.

What it does

hide partStops that part of Discord showing. Parts.
show partSwitches on something Discord has but keeps off.
text effect valueChanges Discord's text: font, size, colour and more. Effects.
add "…" after {data}Adds text after a piece of data wherever Discord shows it. The text can include more data.
on button do actionPillar does the action when the button is pressed, and says what happened.

A value can be a setting: text size $scale uses whatever the scale choice is set to.

Only sometimes

End any line with if to apply it only while settings say so:

hide gift-button if $gift
text size 1.2 if not $compact
add " ({server.members})" after {server.name} if $show is "members" and $counts

Changing a setting applies straight away.

When it isn't right

The store's check reads your plugin and says what's wrong, by line: an unknown part, a font Pillar doesn't have, a setting that doesn't exist. Nothing is listed until every line passes.

PCC

The Pillar Classifier Collection: everything a plugin can name. Each entry is built into Pillar and reviewed once, for every plugin to use. Something missing? Ask for it on the store; adding to the PCC is how Pillar grows.

Parts: hide or show

hide gift-buttonThe gift button in the message box.
iPhone, Mac, Windows
hide nameplatesDecorative backgrounds behind names in lists.
iPhone, Mac, Windows
hide avatar-decorationsFrames and effects around profile pictures.
iPhone, Mac, Windows
hide profile-effectsAnimated effects on profiles.
iPhone
hide server-tagsServer tags next to names.
iPhone, Mac, Windows
hide typing-indicatorThe "someone is typing" line.
iPhone, Mac, Windows
show chat-header-member-countDiscord's own member count under the channel name, normally off.
iPhone
hide shop-buttonThe shop button on your own profile tab.
iPhone
hide nitro-upsellsNitro offers around the app.
iPhone
hide orbs-balanceThe Orbs balance.
iPhone
hide wishlistsWishlist suggestions on profiles.
iPhone
hide tipsPop-up tips that point at new features.
iPhone
hide new-badges"NEW" labels on features.
iPhone
hide chat-nudgesBanners above the message box.
iPhone
hide sticker-greetingThe wave sticker suggestion in a new direct message.
iPhone
hide voice-message-buttonThe microphone button in the message box.
iPhone
hide jump-to-presentThe button that jumps to the newest message.
iPhone
hide new-messages-barThe "new messages since" bar.
iPhone
hide unread-barsUnread pills at the edges of lists.
iPhone, Mac, Windows
hide create-server-buttonThe add-a-server button.
iPhone, Mac, Windows
hide activity-status"Playing…" lines in member lists.
iPhone, Mac, Windows
hide activity-cardsGame and music cards on profiles.
iPhone
hide leaderboard-badgesLeaderboard badges in member lists.
iPhone
hide profile-badgesBadges on profiles.
iPhone
hide custom-statusCustom statuses on profiles.
iPhone
hide profile-connectionsConnected accounts on profiles.
iPhone
hide profile-mutualsMutual friends and servers on profiles.
iPhone
hide join-datesJoin dates on profiles.
iPhone

Text: text <effect> <value>

text fontThe typeface. Code stays monospaced and bold stays bold..
iPhone, Mac, Windows
text sizeScales text, e.g. 1.1 for 10% bigger (0.5 to 2).
iPhone, Mac, Windows
text colorColour for text that has none of its own.
iPhone, Mac, Windows
text weightnormal or bold.
iPhone
text casenormal, upper or lower.
iPhone
text spacingLetter spacing, -2 to 4.
iPhone

Fonts: System, Avenir Next, Futura, Gill Sans, Georgia, Baskerville, Chalkboard SE, Menlo, American Typewriter, Courier New, Helvetica Neue, Palatino, Times New Roman, Verdana, Trebuchet MS, Segoe UI.

Data: {name} in added text

{server.name}The name of the server you're looking at.
iPhone
{server.members}Its member count, like 12,345.
iPhone
{server.online}How many of them are online.
iPhone

Actions: on <button> do <action>

mark-all-readMarks every unread channel as read.
iPhone, Mac, Windows

Privacy labels

Every plugin shows what it does and what it can see before anyone installs it. You don't write these: Pillar works them out from your plugin's lines, so they always match what it does.

No codeOn every plugin: it's PSL, and Pillar carries it out.
Hides or shows parts of DiscordIt uses hide or show.
Changes how text looksIt uses text, without reading what the text says.
Reads from Discord: …Which data it uses in added text, in plain words.
Acts only when you press its buttonIt has a button that does something in Discord.
Nothing leaves your deviceOn every plugin: PSL can't connect to anything.

What isn't here

There is no way to get the user's token, and nothing for sending messages or acting as the user. Plugins that work around that aren't listed.