Skip to main content

LFG List Functions

Overview

The core.lfg_list module wraps the WoW C_LFGList API, providing access to the Looking For Group search system. You can trigger searches, inspect results, apply to groups, and manage applicants for groups you are hosting.

note

Search results arrive asynchronously. After calling search(), wait for the LFG_LIST_SEARCH_RESULT_UPDATED event before reading results.


core.lfg_list.search

Syntax
core.lfg_list.search(category_id, filter?, preferred_filters?) -> boolean

Parameters

  • category_id: integer - The LFG category ID to search.
  • filter (Optional): integer - Search filter bitmask. Default 0.
  • preferred_filters (Optional): integer - Preferred filter bitmask. Default 0.
Returns
  • boolean: true if the search was issued, false if it was skipped (e.g. the Blizzard LFG or PVE frame is open).
Description

Triggers a Looking For Group search. The search is skipped if the Blizzard LFG or PVE frame is currently shown, because re-searching while those frames render tooltips would cause in-game Lua errors.

Example Usage

-- Search for M+ groups (category 2)
local issued = core.lfg_list.search(2)
if not issued then
core.log("Search skipped — LFG frame is open")
end

core.lfg_list.get_search_results

Syntax
core.lfg_list.get_search_results() -> table
Returns
  • table: A results table with the following structure:
FieldTypeDescription
total_resultsintegerThe total number of results
result_idsnumber[]Array of search result IDs
Description

Returns the current LFG search results. Call this after a search has completed.

Example Usage

local results = core.lfg_list.get_search_results()
core.log("Found " .. results.total_results .. " groups")
for _, id in ipairs(results.result_ids) do
core.log("Result ID: " .. id)
end

core.lfg_list.has_search_result_info

Syntax
core.lfg_list.has_search_result_info(result_id) -> boolean

Parameters

  • result_id: number - The search result ID.
Returns
  • boolean: true if detailed info is available for this result.
Description

Checks whether detailed info has been loaded for a search result. Some results may not have their info available immediately after a search.


core.lfg_list.get_search_result_info

Syntax
core.lfg_list.get_search_result_info(result_id) -> table | nil

Parameters

  • result_id: number - The search result ID.
Returns
  • table | nil: The result info table, or nil if unavailable. Contains the following fields:
FieldTypeDescription
search_result_idnumberThe search result ID
activity_idintegerThe activity ID
leader_namestringThe group leader's name
namestringThe group listing name
commentstringThe group listing comment
voice_chatstringVoice chat info string
required_ilvlintegerRequired item level
ageintegerListing age in seconds
num_bnet_friendsintegerNumber of Battle.net friends in the group
num_char_friendsintegerNumber of character friends in the group
num_guildmatesintegerNumber of guildmates in the group
is_delistedbooleanWhether the listing has been delisted
num_membersintegerNumber of members in the group
is_auto_acceptbooleanWhether the group auto-accepts applicants
required_honor_levelintegerRequired honor level
Description

Returns detailed information about a search result, including group name, leader, comment, member count, and requirements.

Example Usage

local info = core.lfg_list.get_search_result_info(result_id)
if info then
core.log(info.name .. " (leader: " .. info.leader_name .. ", members: " .. info.num_members .. ")")
end

core.lfg_list.get_search_result_member_counts

Syntax
core.lfg_list.get_search_result_member_counts(result_id) -> table | nil

Parameters

  • result_id: number - The search result ID.
Returns
  • table | nil: Role slot counts for the search result, or nil if unavailable.
FieldTypeDescription
tankintegerFilled tank slots
healerintegerFilled healer slots
damagerintegerFilled damage slots
tank_remainingintegerOpen tank slots
healer_remainingintegerOpen healer slots
damager_remainingintegerOpen damage slots
Description

Returns filled and remaining role slot counts for a search result. This is useful for filtering groups by remaining role needs.

Example Usage

local counts = core.lfg_list.get_search_result_member_counts(result_id)
if counts and counts.healer_remaining > 0 then
core.log("This group still needs a healer")
end

core.lfg_list.apply_to_group

Syntax
core.lfg_list.apply_to_group(result_id, tank, healer, damage) -> boolean, string | nil

Parameters

  • result_id: number - The search result ID to apply to.
  • tank: boolean - Whether to apply as tank.
  • healer: boolean - Whether to apply as healer.
  • damage: boolean - Whether to apply as damage.
Returns
  • boolean: true if the apply call was issued without error.
  • string | nil: Error message if the call failed, nil on success.
Description

Applies to a group listing with the specified roles. The actual application outcome arrives via the LFG_LIST_APPLICATION_STATUS_UPDATED event — success here only means the call was issued without a Lua error.

Example Usage

-- Apply as DPS
local success, err = core.lfg_list.apply_to_group(result_id, false, false, true)
if not success then
core.log("Apply failed: " .. (err or "unknown"))
end

core.lfg_list.get_applicants

Syntax
core.lfg_list.get_applicants() -> integer[]
Returns
  • integer[]: Array of applicant IDs for a group you are hosting.
Description

Returns the list of applicant IDs for a group you are currently hosting.

Example Usage

local applicants = core.lfg_list.get_applicants()
core.log("Pending applicants: " .. #applicants)

core.lfg_list.get_applicant_info

Syntax
core.lfg_list.get_applicant_info(applicant_id) -> table | nil

Parameters

  • applicant_id: number - The applicant ID.
Returns
  • table | nil: The applicant info table, or nil if unavailable. Contains the following fields:
FieldTypeDescription
applicant_idnumberThe applicant ID
application_statusstringThe current application status
pending_application_statusstringThe pending application status
num_membersintegerNumber of members in the applicant's group
is_newbooleanWhether the applicant is new
commentstringThe applicant's comment
display_order_idintegerThe display order ID
Description

Returns detailed information about an applicant to your hosted group.

Example Usage

local info = core.lfg_list.get_applicant_info(applicant_id)
if info then
core.log("Applicant: " .. info.comment .. " (status: " .. info.application_status .. ")")
end

core.lfg_list.cancel_application

Syntax
core.lfg_list.cancel_application(result_id) -> boolean, string | nil

Parameters

  • result_id: number - The search result ID of the group to cancel the application for.
Returns
  • boolean: true if the cancel call was issued without error.
  • string | nil: Error message if the call failed, nil on success.
Description

Cancels a pending application to a group listing.

Example Usage

local success, err = core.lfg_list.cancel_application(result_id)
if not success then
core.log("Cancel failed: " .. (err or "unknown"))
end

core.lfg_list.accept_invite

Syntax
core.lfg_list.accept_invite(result_id) -> boolean, string | nil

Parameters

  • result_id: number - The search result ID of the group invite to accept.
Returns
  • boolean: true if the accept call was issued without error.
  • string | nil: Error message if the call failed, nil on success.
Description

Accepts a group invite from the LFG system.

Example Usage

local success, err = core.lfg_list.accept_invite(result_id)
if not success then
core.log("Accept failed: " .. (err or "unknown"))
end

core.lfg_list.get_application_info

Syntax
core.lfg_list.get_application_info(result_id) -> table | nil

Parameters

  • result_id: number - The search result ID.
Returns
  • table | nil: The application info table, or nil if unavailable. Contains:
FieldTypeDescription
app_idnumberThe application ID
app_statusstringThe current application status
pending_statusstringThe pending application status
app_durationnumberThe application duration in seconds

Application status values: "none", "applied", "invited", "failed", "cancelled", "declined", "declined_full", "declined_delisted", "timedout", "inviteaccepted", "invitedeclined"

Description

Returns the application status for a search result. Use this to track whether your application is pending, has been invited, declined, etc.

Example Usage

local app = core.lfg_list.get_application_info(result_id)
if app and app.app_status == "invited" then
core.lfg_list.accept_invite(result_id)
end

core.lfg_list.refresh_search_panel

Syntax
core.lfg_list.refresh_search_panel() -> boolean, string | nil
Returns
  • boolean: true if the click was issued without error.
  • string | nil: Error message if the call failed, nil on success.
Description

Programmatically clicks the refresh button on the Blizzard LFG search panel. Requires the search panel to be open.

Example Usage

local success, err = core.lfg_list.refresh_search_panel()
if not success then
core.log("Refresh failed: " .. (err or "unknown"))
end

core.lfg_list.search_panel_is_visible

Syntax
core.lfg_list.search_panel_is_visible() -> boolean
Returns
  • boolean: true if the Blizzard LFG search panel is currently visible.
Description

Checks whether the Blizzard LFG search panel (LFGListFrame.SearchPanel) is currently visible.

Example Usage

if core.lfg_list.search_panel_is_visible() then
core.lfg_list.refresh_search_panel()
end