# Commands & Permissions

{% hint style="info" %}
**Command not working?**

The command needs to be enabled in the **config.yml** for it to function properly. If the issue still persists please report it.
{% endhint %}

## Player Commands (pa.commands)

| Command                                 | Description                                     | Permission            |
| --------------------------------------- | ----------------------------------------------- | --------------------- |
| /pa help                                | Displays this menu.                             | N/A                   |
| /pa sell \<price> \[currency] \[amount] | Sell an item.                                   | pa.limit.<#>          |
| /pa bid \<price>                        | Bid an item.                                    | pa.bid & pa.limit.<#> |
| /pa auction \[player] \[price]          | Auction via a GUI.                              | pa.auction            |
| /pa cancel \[id] \[player]              | Cancel your auctioning items.                   | pa.cancel             |
| /pa collect                             | Collect cancelled/expired items.                | pa.collect            |
| /pa amount \[player]                    | Check how many auctions you have.               | pa.amount             |
| /pa open \[menu] \[options]             | Opens the player menu.                          | pa.open               |
| /pa search \<query> \[options]          | Search for a item/player.                       | pa.search             |
| /pa blacklist add \[player]             | Blacklist a player from buying your auctions.   | pa.blacklist          |
| /pa blacklist remove \[player]          | Unblacklist a player from buying your auctions. | pa.blacklist          |
| /pa blacklist list                      | List of blacklisted players.                    | pa.blacklist          |

## Admin Commands

| Command                             | Description                    | Permission           |
| ----------------------------------- | ------------------------------ | -------------------- |
| /pa reload                          | Reloads all the config files.  | pa.admin.reload      |
| /pa addauctions \<player> \<amount> | Add more auctions to a player. | pa.admin.addauctions |

## Rest API Commands

| Command                          | Description               | Permission            |
| -------------------------------- | ------------------------- | --------------------- |
| /pa apitokens                    | Shows the help menu.      | pa.apitokens          |
| /pa apitokens delete \[player]   | Delete your API token.    | pa.apitokens.delete   |
| /pa apitokens generate \[player] | Generate a new API token. | pa.apitokens.generate |

{% hint style="info" %}
**Permissions not working?**

The <> in some permissions are placeholders, you will need to replace them with a valid value like requested.
{% endhint %}

## Player Permissions

| Permission           | Description                         |
| -------------------- | ----------------------------------- |
| pa.purchase          | Purchase an auction.                |
| pa.purchase.notify   | Get notified upon auction purchase. |
| pa.amount.others     | View other players' auction amount. |
| pa.recent.remove     | Remove recent auctions in the GUI.  |
| pa.cooldown.bid      | Bypass auction bidding cooldown.    |
| pa.cooldown.sell     | Bypass auction selling cooldown.    |
| pa.cooldown.purchase | Bypass auction purchasing cooldown. |
| pa.cooldown.offer    | Bypass bid offering cooldown.       |

## Admin Permissions

| Permission             | Description                                            |
| ---------------------- | ------------------------------------------------------ |
| pa.admin.cancel        | Cancel another player's auction                        |
| pa.admin.update        | When a player joins they receive update notifications. |
| pa.admin.open          | Use open options for opening a menu.                   |
| pa.admin.expire        | Auctions do not expire.                                |
| pa.admin.collectrecent | Collect items from the recent auctions GUI.            |
| pa.admin.apitokens     | Remove/Generate other players' API tokens.             |

## Open Options Syntax

Open options are an easy way for you to change how the open command is processed, here are the latest options and examples for Player Auctions.

| Option  | Description                                           | Example             |
| ------- | ----------------------------------------------------- | ------------------- |
| player  | Open the menu for that player.                        | -player NotchIsCool |
| view    | View the menu as that player.                         | -view Olzie12       |
| search  | Add a search input to the search menu for the player. | -search "diamond"   |
| auction | Define specific auction for specific auction menus.   | -auction 21         |

With the examples shown above this is how its used in the command:`/pa open <menu> -player NotchIsCool -view Olzie12`. This will open the menu for NotchIsCool but the contents of the menu will be viewed as Olzie12, this is good for checking other players auctions in a menu.

Another example: `/pa open <menu> -view Olzie12`. This will open the menu for the executor (if it isn't console) and will be viewing it as Olzie12.

I mentioned above with the console executor, yes using the command in console will always need the `player` option to open it for that player.

For players to be able to use this, they will need `pa.admin.open` and is not suggested to give this to any normal player as they can just view menus as other players and edit their auctions.

Using the `search` option allows you to automatically enter a search input when a menu (that allows searching) has been opened, there isn't a required permission like all the others. You will need to surround the value in speech marks. For example `/pa open <search menu> -search "farm`". This will search for any auctions containing as its item `"diamond"`.
