# Discord notices

Turn on the private messages the city's bot sends to buyers: payment, delivery, gifts and VIPs about to expire.

Source: https://fivedash.fivex.gg/docs/en/store/discord-notices

Discord notices keep buyers in the loop without anyone on the team having to answer. The server's bot sends a private message (DM) at each moment of the purchase: order received, payment approved, delivery in the city, a gift from the team and a VIP about to expire, with a button to renew. You turn them on, write them and test them in **Store → Discord notices**.

## Before you start

* **Plan:** Discord notices come with every plan that has the **Store** module.
* **Discord bot:** notices go out through this server's bot. Until it's set up, the page shows **Connect the Discord bot first** with **Set up the bot**.
* **Buyer with Discord:** a notice only goes out when the order has the buyer's Discord (purchases made signed in with Discord on the website or through the Discord cart). The buyer must be in the Discord server and accept private messages.
* **Permissions** (**Discord notices** area):

| Action                                                     | Level         |
| ---------------------------------------------------------- | ------------- |
| Notices sent and VIPs expiring                             | **View**      |
| Turn notices on, texts and look (includes **Send a test**) | **Configure** |

## Turn on notices

### Open the page

Go to **Store → Discord notices**. While they're off, the **Notices are off.** notice shows.

### Check the texts

Review the notices in each group and turn each one on or off with the switch beside it.

### Turn them on

Turn on the **Turn on notices** switch at the top of the page (or click **Turn on notices** in the notice).

### Save

Click **Save**. The **Notices on** notice confirms it: the bot now sends the next messages.

> Nothing goes out while **Turn on notices** is off, even with individual notices on. Each notice goes out once per order; the VIP one, once per expiration.

## The notices

| Notice                    | When it goes out                                                               | Button             | Default |
| ------------------------- | ------------------------------------------------------------------------------ | ------------------ | ------- |
| **Order received**        | Right after checkout, with a button to pay.                                    | **Pay now**        | Off     |
| **Payment approved**      | When the payment is confirmed.                                                 | **View order**     | On      |
| **Payment expired**       | The Pix expired unpaid: a reminder to buy again.                               | **Open the store** | Off     |
| **Payment refunded**      | When the provider refunds the money.                                           | **View order**     | On      |
| **Delivered in the city** | When the city confirms it delivered everything.                                | **View order**     | On      |
| **Delivery problem**      | The city couldn't deliver: lets them know the team will sort it out.           | **View order**     | On      |
| **Gift from the team**    | When the team gives a product from the panel.                                  | **View order**     | On      |
| **VIP about to expire**   | A few days before the end (see **Remind in advance**), with a button to renew. | **Renew**          | On      |
| **VIP expired**           | On the day it ends, with a button to renew.                                    | **Renew**          | On      |

On the page, notices are in three groups: **Order and payment**, **Delivery in the city** and **VIPs and subscriptions**.

> The buttons open the store's website and only show with the website live. With the website offline, messages go without a button; the **Pay now** button on Discord purchases stays.

## Edit a notice

### Open the notice

Click **Edit** on the notice's row. The **Discord preview**, alongside, switches to that notice.

### Write

Change the **Title** (highlighted at the top of the message) and the **Message**. Use the variables in the table below.

### Save

Close the window and click **Save**.

| Field       | What it does                                          | Limit           |
| ----------- | ----------------------------------------------------- | --------------- |
| **Title**   | Highlighted at the top of the message.                | 120 characters  |
| **Message** | The notice's text. Accepts Discord bold (`**text**`). | 1500 characters |

A notice that's on needs a title or a message; otherwise the panel won't save and shows which notice is empty. The texts start in the city's language.

### Variables

The variables keep their Portuguese names in every language.

| Variable       | Works in      | What it becomes                                              |
| -------------- | ------------- | ------------------------------------------------------------ |
| `{membro}`     | All           | Mentions the buyer                                           |
| `{nome}`       | All           | The buyer's name                                             |
| `{loja}`       | All           | The store's name                                             |
| `{pedido}`     | Order notices | The order number                                             |
| `{total}`      | Order notices | The order's amount                                           |
| `{itens}`      | Order notices | What was bought                                              |
| `{id}`         | All           | Who receives it in the city (for VIPs, who has the VIP)      |
| `{produto}`    | VIP notices   | The VIP that expires                                         |
| `{vencimento}` | VIP notices   | Day and time it ends, in the reader's time zone              |
| `{tempo}`      | VIP notices   | How long is left (like "em 3 dias" for a city in Portuguese) |

In order notices, the items, the total and who receives it already show below the text when **Order details** is on.

### Default texts

These are the defaults for cities set to English.

| Notice                    | Title                            | Message                                                                                                                                           |
| ------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Order received**        | `Order #{pedido} received`       | `Hi, {nome}! Your order at **{loja}** is waiting for payment. As soon as you pay, it goes straight to the city.`                                  |
| **Payment approved**      | `Payment approved`               | `Thanks for your purchase, {nome}! Payment for order **#{pedido}** was approved and delivery is on its way to the city.`                          |
| **Delivered in the city** | `Delivered in the city`          | `All set, {nome}! Order **#{pedido}** is already on ID **{id}**. Have fun!`                                                                       |
| **Delivery problem**      | `We had a problem with delivery` | `{nome}, the city couldn't deliver order **#{pedido}**. We've already told the team and they'll sort it out: no need to buy again.`               |
| **Payment expired**       | `Time to pay ran out`            | `The Pix for order **#{pedido}** expired and nothing was charged. If you still want it, just buy again at **{loja}**.`                            |
| **Payment refunded**      | `Payment refunded`               | `The payment for order **#{pedido}** ({total}) was refunded. The money goes back the same way you paid.`                                          |
| **Gift from the team**    | `You got a gift!`                | `The **{loja}** team gave you **{itens}**. It's already on its way to ID **{id}** in the city.`                                                   |
| **VIP about to expire**   | `Your {produto} expires {tempo}` | `{nome}, your **{produto}** ends on **{vencimento}**. Renew before then to keep your perks: the new days are added after the ones you have left.` |
| **VIP expired**           | `Your {produto} has expired`     | `Your **{produto}** ended today. Miss it already? Renew at the store and your perks come back right away.`                                        |

Each default title starts with an emoji from the bot's pack.

## VIPs and subscriptions

VIP notices apply to groups sold by the day (a group delivery with a duration). Permanent ones never expire.

| Field                 | What it does                                                                                | Default       |
| --------------------- | ------------------------------------------------------------------------------------------- | ------------- |
| **Remind in advance** | How many days before the end **VIP about to expire** goes out: 1, 2, 3, 5 or 7 days before. | 3 days before |

How FiveDash works out the expiration:

* It counts from the delivery confirmed in the city.
* Renewing before the end adds the new days after the ones left; renewing after the end starts over.
* Buying the same group as permanent makes the VIP permanent.
* Gifts to another player's ID are left out, because the receiver's Discord isn't known.
* **VIP expired** only goes out up to 3 days after the end. Old expirations don't trigger a notice.
* A renewal that moves the date triggers a new **VIP about to expire**.

The **VIPs expiring** list shows groups bought by the day that end in the next 7 days. With the website live, the notice's **Renew** button goes straight to the product.

## Appearance

Click **Appearance** (Color, server at the top, details, button and footer) to open **Customize the appearance**. It applies to every notice.

| Field                        | What it does                                                                                                        | Default         |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------- | --------------- |
| **Color**                    | The color of the strip beside the message.                                                                          | **Store color** |
| **Color for each situation** | Green when it goes right, red for a problem, yellow when about to expire. Turned off, they all use the color above. | On              |
| **Server at the top**        | The server's name and icon above the message.                                                                       | On              |
| **Order details**            | Number, total, items and who receives it (for VIPs, when it expires) below the text.                                | On              |
| **Button to the store**      | **Pay now**, **View order** or **Renew**, opening the store's website. Only shows with the website live.            | On              |
| **Footer**                   | Text below the message, up to 100 characters. Empty, it shows the store's name.                                     | Empty           |

## Send a test

### Pick the notice

Hover over or click **Edit** on the notice you want to test. The preview shows that notice.

### Type your ID

In **Send a test**, paste your Discord ID (numbers only, 17 to 20 digits). You need to be in the bot's server.

### Send

Click **Send**. The notice arrives in your DM as shown in the preview, with sample data and the line "Test: this is how the player gets it." The test uses the texts on screen, even before saving, and doesn't go into the history.

## History and numbers

At the top, **Notice numbers** shows **Sent · 7 days** (with the week before), **Delivered**, **Not delivered** and **VIPs expiring** in the next 7 days.

The **Recently sent** list shows every message the bot sent (or tried to). Filter by **All**, **Delivered** or **Not delivered** and click **Refresh** to read it again.

| Status            | What it means                                           |
| ----------------- | ------------------------------------------------------- |
| **Delivered**     | Discord delivered the message.                          |
| **Not delivered** | Discord didn't deliver it. The reason shows on the row. |
| **Empty**         | The message was empty and wasn't sent.                  |

| Reason                                                                 | What to do                                               |
| ---------------------------------------------------------------------- | -------------------------------------------------------- |
| The player has private messages closed or isn't in the Discord server. | Ask the player to join the server and allow DMs from it. |
| Discord asked us to wait (too many messages at once).                  | Nothing: it's a Discord limit during sales peaks.        |
| Discord rejected the bot's token.                                      | Replace the token in the bot's module.                   |
| The Discord bot hasn't finished setting up yet.                        | Finish the setup in **Discord → Bot**.                   |

## FAQ

**A buyer didn't get the notice. Why?**
Look for their row in **Recently sent**. The most common reasons are closed DMs or the player not being in the Discord server. If there's no row, check that the order has the buyer's Discord and that the notice was on.

**Can I send a notice again?**
No. Each notice goes out once per order, so the buyer doesn't get repeats.

**Did the VIP notice go out for a gift?**
No. Gifts to another player's ID aren't part of the VIP notices.

## Next steps

[Discord bot](https://fivedash.fivex.gg/docs/en/discord/bot)Set up the bot that sends the notices.
[In-game delivery](https://fivedash.fivex.gg/docs/en/store/in-game-delivery)How the city confirms delivery.
[Orders](https://fivedash.fivex.gg/docs/en/store/orders)Follow each order's payment and delivery.
[Store website](https://fivedash.fivex.gg/docs/en/store/site)Put the website live so the buttons show.
