Commands API

Commands exposed as part of the Geoffrey Command API

Note

To use these commands on the API, you must supply a valid token using the api parameter

class GeoffreyApp.api.commands.RequestTypes(value)

An enumeration.

GeoffreyApp.api.commands.add_attraction(x_pos, z_pos, dimension='O', name=None, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • x_pos – MC X Coordinate

  • z_pos – MC Z Coordinate

  • dimension – MC Dimension

  • name – Market Name (If None, Defaults to Player’s Attraction)

  • discord_uuid – Discord UUID

  • mc_uuid – Minecraft UUID

Returns

JSON representation of the attraction

Raises

EntryNameNotUniqueError, PlayerNotFound, LocationLookupError

Help

Adds your attraction to the database.

GeoffreyApp.api.commands.add_base(x_pos, z_pos, dimension='O', name=None, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • x_pos – MC X Coordinate

  • z_pos – MC Z Coordinate

  • dimension – MC Dimension

  • name – Base Name (If None, Defaults to Player’s Base)

  • discord_uuid – Discord UUID

  • mc_uuid – Minecraft UUID

Returns

JSON representation of the new base

Raises

EntryNameNotUniqueError, PlayerNotFound, LocationLookupError

Help

Adds your base to the database.

GeoffreyApp.api.commands.add_farm(x_pos, z_pos, dimension='O', name=None, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • x_pos – MC X Coordinate

  • z_pos – MC Z Coordinate

  • dimension – MC Dimension

  • name – Farm Name (If None, Defaults to Player’s Farm)

  • discord_uuid – Discord UUID

  • mc_uuid – Minecraft UUID

Returns

JSON representation of the new farm

Raises

EntryNameNotUniqueError, PlayerNotFound, LocationLookupError

Help

Adds your public farm to the database.

GeoffreyApp.api.commands.add_item(item_name, quantity, diamond_price, shop_name=None, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • item_name – name of the item

  • quantity – number of items being sold

  • diamond_price – price in diamonds

  • shop_name – Name of the shop, can be blank if the user only has one shop

  • discord_uuid – Discord UUID

  • mc_uuid – Minecraft UUID

Returns

Item Listing

Raises

PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase

Help

Adds an item to a shop’s inventory.

GeoffreyApp.api.commands.add_market(x_pos, z_pos, dimension='O', name=None, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • x_pos – MC X Coordinate

  • z_pos – MC Z Coordinate

  • dimension – MC Dimension

  • name – Market Name (If None, Defaults to Player’s Market)

  • discord_uuid – Discord UUID

  • mc_uuid – Minecraft UUID

Returns

JSON representation of the market

Raises

EntryNameNotUniqueError, PlayerNotFound, LocationLookupError

Help

Adds your market to the database.

GeoffreyApp.api.commands.add_owner(new_owner_name, location_name, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • new_owner_name – The MC username of the new owner

  • location_name – The name of the location to add them to

  • discord_uuid – Discord UUID of the current owner

  • mc_uuid – MC UUID of the current owner

Returns

Update Location

Raises

PlayerNotFound, LocationLookupError, IsOwnerError, OwnerNotFound

Help

Adds a co-owner to a location.

GeoffreyApp.api.commands.add_resident(new_resident_name, town_name, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • new_resident_name – The MC username of the new resident

  • town_name – The name of the town to add the resident to, can be blank if the owner has one town

  • discord_uuid – Discord UUID of the town owner

  • mc_uuid – MC UUID of the town owner

Returns

Updated Location

Raises

PlayerNotFound, LocationLookupError, IsResidentError, ResidentNotFoundError

Help

Adds a resident to a town.

GeoffreyApp.api.commands.add_resource(resource_name, farm_name=None, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • resource_name – name of the resource

  • farm_name – name of the farm to add the resource to. Can be none.

  • discord_uuid – Discord UUID

  • mc_uuid – Minecraft UUID

Returns

Item Listing

Raises

PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase

Help

Adds a resource to a farm.

GeoffreyApp.api.commands.add_shop(x_pos, z_pos, dimension='O', name=None, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • x_pos – MC X Coordinate

  • z_pos – MC Z Coordinate

  • dimension – MC Dimension

  • name – Shop Name (If None, Defaults to Player’s Shop)

  • discord_uuid – Discord UUID

  • mc_uuid – Minecraft UUID

Returns

JSON representation of the new shop

Raises

EntryNameNotUniqueError, PlayerNotFound, LocationLookupError

Help

Adds your shop to the database.

GeoffreyApp.api.commands.add_town(x_pos, z_pos, dimension='O', name=None, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • x_pos – MC X Coordinate

  • z_pos – MC Z Coordinate

  • dimension – MC Dimension

  • name – Town Name (If None, Defaults to Player’s Town)

  • discord_uuid – Discord UUID

  • mc_uuid – Minecraft UUID

Returns

JSON representation of the new town

Raises

EntryNameNotUniqueError, PlayerNotFound, LocationLookupError

Help

Adds your town to the database.

GeoffreyApp.api.commands.add_tunnel(tunnel_direction, tunnel_number, location_name=None, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • tunnel_direction – Tunnel Direction

  • tunnel_number – Tunnel Coordinate

  • location_name – Name of the Location to attach the tunnel to

  • discord_uuid – Discord UUID

  • mc_uuid – Minecraft UUID

Returns

JSON Representation of the Tunnel

Raises

PlayerNotFound, LocationHasTunnelError, EntryNameNotUniqueError, NoLocationsInDatabase, InvalidTunnelError

Help

Adds your tunnel to the database.

GeoffreyApp.api.commands.delete(name, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • name – Name of location to delete

  • discord_uuid – Discord UUID

  • mc_uuid – Minecraft UUID

Returns

Location Name

Raises

LocationLookUpError

Help

Deletes a location from the database

GeoffreyApp.api.commands.delete_item(item, shop_name=None, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • item – Item name to delete

  • shop_name – Shop selling item, can be None if the user only has one shop

  • discord_uuid – Discord UUID

  • mc_uuid – Minecraft UUID

Returns

Shop where the item was deleted from

Raises

PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase, ItemNotFound

Help

Deletes an item from a shop.

GeoffreyApp.api.commands.delete_resource(resource, farm_name=None, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • resource – resource to delete

  • farm_name – Farm with resource, can be None if the user only has one farm

  • discord_uuid – Discord UUID

  • mc_uuid – Minecraft UUID

Returns

PublicFarm where the resource was deleted from

Raises

PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase, ItemNotFound

Help

Deletes a resource from a farm.

GeoffreyApp.api.commands.edit_name(new_name, loc_name, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • new_name – New Location Name

  • loc_name – Old Location name

  • discord_uuid – Discord UUID

  • mc_uuid – MC UUID

Returns

Edited Location

Raises

PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase

Help

Edits the name of a location.

GeoffreyApp.api.commands.edit_pos(x, z, loc_name, dimension='O', discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • x – New MC X coordinate

  • z – New MC Z Coordinate

  • dimension – MC Dimension

  • loc_name – Location Name to edit

  • discord_uuid – Discord UUID

  • mc_uuid – MC UUID

Returns

Edited Location

Raises

Raises

PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase

Help

Edits the position of a location.

GeoffreyApp.api.commands.edit_tunnel(tunnel_direction, tunnel_number, loc_name, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • tunnel_direction – New Tunnel Direction

  • tunnel_number – New Tunnel Address

  • loc_name – Location Name to edit

  • discord_uuid – Discord UUID

  • mc_uuid – Minecraft UUID

Returns

Edited Location

Raises

PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase

Help

Edits the tunnel of a location.

GeoffreyApp.api.commands.find_around(x_pos, z_pos, radius=200)
Request

GET

Parameters
  • x_pos – MC X Coordinate

  • z_pos – MC Z Coordinate

  • radius – Radius to each around (default 200)

Returns

List of all locations in the radius

Raises

LocationLookupError

Help

Finds all the locations around a certain point.

GeoffreyApp.api.commands.find_farm(resource_name)
Request

GET

Parameters

resource_name – Resource to search for

Returns

List of top matching farms

Raises

ResourceNotFoundError

Help

Lists farms that produce a resource.

GeoffreyApp.api.commands.find_location(search, limit=25)
Request

GET

Parameters
  • search – Location name or owner to search for

  • limit – How man locations to return

Returns

List of the matching locations

Raises

LocationLookupError

Help

Finds all the locations matching the search term

GeoffreyApp.api.commands.info(location_name)
Request

GET

Parameters

location_name – Name of the location to get info on.

Returns

JSON representation of location

Raises

LocationLookupError

Help

Gives additional info about a location.

GeoffreyApp.api.commands.me(discord_uuid=None, mc_uuid=None)
Request

GET

Parameters
  • discord_uuid – Discord UUID

  • mc_uuid – MC UUID

Returns

Returns a list of all the locations owned by a user

Raises

NoLocationsInDatabase, PlayerNotFound

Help

Find all the locations owned by a player in the database.

GeoffreyApp.api.commands.primary_location(loc_name, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • loc_name – location to set as primary

  • discord_uuid – player discord uuid

  • mc_uuid – player mc uuid

Returns

json representation of the primary location

GeoffreyApp.api.commands.register(player_name, discord_uuid=None)
Request

POST

Parameters
  • player_name – Minecraft in-game name

  • discord_uuid – Discord UUID if registering from Discord

Returns

JSON representation of the new Player

Raise

PlayerInDBError

Help

Registers your Discord and Minecraft account with the the database

GeoffreyApp.api.commands.remove_resident(resident_name, town_name, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • resident_name – Name of the resident to remove

  • town_name – Name of the town, can be blank if the owner has one town

  • discord_uuid – Owner discord uuid

  • mc_uuid – Owner mc uuid

Raises

PlayerNotFound, LocationLookupError, ResidentNotFoundError

Returns

Updated town

Help

Removes a resident from a town.

GeoffreyApp.api.commands.restock(item_name, shop_name=None, discord_uuid=None, mc_uuid=None)
Request

POST

Parameters
  • item_name – Item to restock

  • shop_name – Shop the item is in, can be none if the only one location is owned by the user

  • discord_uuid – Discord UUID

  • mc_uuid – Minecraft UUID

Returns

List of items updated

Raises

PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase, ItemNotFound

Help

Restocks items matching the item name in your shop.

GeoffreyApp.api.commands.selling(item_name)
Request

GET

Parameters

item_name – Item name to search for

Returns

List of top matching shops, sorted by the date last restocke

Raises

ItemNotFound

Help

Lists shops selling an item. Sorted by when they were last restocked.

GeoffreyApp.api.commands.selling_price(item_name)
Request

GET

Parameters

item_name – Item name to search for

Returns

List of top matching shops, sorted by the

Raises

ItemNotFound

Help

Lists shops selling an item. Sorted lowest price to highest price.

GeoffreyApp.api.commands.tunnel(player_name)
Request

GET

Parameters

player_name – MC player name

Returns

List of all the tunnels a user owns

Raises

LocationLookUpError

Raises

LocationLookupError

Help

Finds all the tunnels a player owns.