Skip to main content

fetchHotel

exports["RiP-Hotels"]:fetchHotel(hotelID) 

This function fetches the hotel object with all availabel data and rooms. Only use this if really necessary due to large data objects

Arguments

NameTypeOptionalExplenation
hotelIDIntegerYesHotel id or all hotels if nil

Returned Object

Returns the whole hotel object (and business data) with all registered rooms

NameTypeExplenation
ownerStringNil
balanceIntegerBusiness account balance
nameStringNil
bookingBooleanOnly manual booking if disabled
minibarTableBusiness minibar prices
logsObjectBusiness webhooks for room and business
upgradesObjectHotel upgrades (security)
roomsTableAll registered hotel rooms (findHotelRoom)

Example

local hotelData = exports["RiP-Hotels"]:fetchHotel(1) 

if hotelData then
print(json.encode(hotelData))
print(json.encode(hotelData.rooms))
end