Discord Webhooks

Discord Webhooks

View as Markdown ·

On this page

circle-info

Everything on this page can be changed in Editor > Settings > Discord Webhooks, or in discord.yml followed by /pshop reload.

#Discord Webhooks

Phoenix Shop can post what happens in your shops to Discord: purchases, sales, chest shop trades, Auction House activity, price changes, stock running out, restock alerts, admin edits and a daily summary. Each kind of message can have its own webhook, so each can go to a different channel, or they can all share the default webhook. This is a Premium feature.

Messages are queued and sent in the background, so a slow or unreachable Discord never holds up a purchase.

#Setup

1

#Create the webhook

In Discord, open Server Settings > Integrations > Webhooks, create one for the channel you want the messages in, and copy its URL.

2

#Set it in the editor

Paste the URL into Default Webhook to use it for every message, or into the Webhook URL of one message to send that one somewhere else. Then turn on each message you want.

3

#Test it

Send Test in a message's screen posts a test message to its webhook. /pshop webhooktest does the same for the anomaly message and needs the phoenixshop.admin permission.

#Messages

Message Posted when Shows
purchase A player buys from a shop. Player, item, amount, price, currency and shop.
sale A player sells to a shop. Player, item, amount, price, currency and shop.
large-transaction A purchase or sale costs or pays at least the threshold. The same, plus whether it was a purchase or a sale.
price-change The price audit or the price generator changes a price. Shop, item, and the old and new price.
stock-depleted An item with limited stock sells out. Shop and item.
restock An item with limited stock is restocked. Shop, item and the new stock.
restock-alert A restock alert goes out. Shop, item, whether it restocked or its sale window opened, and how many players were alerted.
player-shop-created A player builds a chest shop. Owner, item, mode, prices, currency and location.
player-shop-removed A chest shop is removed. Owner, item, mode, prices, currency and location.
chest-shop-trade A player buys from or sells to a chest shop. Customer, owner, whether they bought or sold, item, amount, price and location.
auction-listed An item is listed on the Auction House. Seller, item, price or starting bid, type and duration.
auction-sold A listing sells or an auction is won. Seller, buyer, item, price and type.
auction-bid A player bids on an auction. Bidder, seller, item, bid and number of bids.
auction-expired A listing ends without selling. Seller, item and price.
auction-removed Staff take down a listing. Staff member, seller and item.
auction-restocked The server restocks the Auction House. The number of new listings.
admin-edit An admin changes anything in the editor. Admin, shop, category, item, what changed and the new value.
daily-summary Once a day, at the set time. See below.
anomaly /pshop webhooktest is run. Who sent the test.

The large transaction message is posted as well as the purchase or sale message, not instead of it. The restock alert message is posted even when no player was alerted.

#Options

Every message has the same options, with a few extras.

YAML
discord:
  default-webhook-url: ''
  purchase:
    enabled: false
    webhook-url: ''
    username: Phoenix Shop
    avatar-url: ''
    embed:
      title: Purchase
      color: '#57f287'
  large-transaction:
    threshold: 10000
  chest-shop-trade:
    minimum-price: 0
  daily-summary:
    time: '00:00'
  restock-alert:
    message:
      restocked: '%item% is back in stock in %shop%.'
      window-opened: '%item% is on sale again in %shop%.'
Option Description
default-webhook-url The webhook every message uses when it has no webhook-url of its own. Each message still has to be enabled.
enabled Whether this message is posted at all.
webhook-url The Discord webhook URL. Empty uses default-webhook-url; nothing is posted while both are empty.
username The name the webhook posts under.
avatar-url An image URL used as the webhook's avatar. Empty uses the webhook's own.
embed.title The embed's heading. Empty uses the message's default title.
embed.color The colour of the embed's side bar, as a hex value.
threshold Large transaction only. The price at which a purchase or sale counts as large, in any currency.
minimum-price Chest shop trade, auction listed, auction sold and auction bid only. Cheaper trades, listings and bids are not posted, so a busy server does not flood the channel. 0 posts everything. Trades paid in items are always posted.
time Daily summary only. The time of day to post, as HH:MM on the server's clock.
message Restock alert only. The text posted when the item restocks, and when it goes on sale again. %item% and %shop% are filled in.

#Daily Summary

Posted once a day at the set time, covering the 24 hours before it: the number of purchases and sales, what players spent and were paid per currency, the most traded item, and the player who bought and the player who sold the most. Undone transactions are left out. A day with no transactions says so.

A time the plugin cannot read switches the summary off and leaves a warning in the console.

#Troubleshooting

If messages are not arriving, check the console. The plugin warns once per webhook, without printing the URL, when Discord refuses a post or cannot be reached.

  • The URL is wrong. It must be the full https://discord.com/api/webhooks/... address, not a link to the channel.
  • The webhook was deleted in Discord. The plugin keeps posting to an address that no longer exists until the URL is changed.
  • Rate limits. When Discord asks the plugin to slow down, it waits and sends the rest after. Up to 64 messages wait in the queue, and anything past that is dropped, so a very busy shop with purchase, sale or chest shop trade messages on can lose some.
My Cart
Spider

Your cart is empty

Looks like the spiders padded through here. Pick a plugin and it will show up here. Continue shopping