Violet

Guild

On this page

Use core.guild to inspect the current character's guild state, read outgoing applications, and enter the Guild Castle.

Read functions return nil, error_message when character data is unavailable. A character that is not in a guild has ID 0, an empty name, and no members.

Guild Member Structure

core.guild.get_members() returns an array of guild members:

PropertyTypeDescription
idnumberCharacter ID
namestringCharacter name

Guild Application Structure

core.guild.get_pending_applications() returns outgoing applications:

PropertyTypeDescription
guild_idnumberGuild ID
guild_namestringGuild name

Functions

core.guild.get_id() -> number | nil, string?

Returns the current guild ID, or 0 when the character is not in a guild.


core.guild.get_name() -> string | nil, string?

Returns the current guild name, or an empty string when the character is not in a guild.


core.guild.is_in_guild() -> boolean | nil, string?

Returns whether the current character belongs to a guild.


core.guild.get_members() -> table<guild_member> | nil, string?

Returns the current guild roster. The returned table is empty when the character is not in a guild.


core.guild.get_pending_applications() -> table<guild_application> | nil, string?

Returns the current character's outgoing guild applications after the Guild search view has loaded them. Returns nil, error_message when that data is not currently available.


core.guild.move_to_castle() -> boolean, string?

Requests entry to the current guild's Castle. Returns false, error_message when the character is not in a guild or the action is unavailable.

lua
local in_guild, err = core.guild.is_in_guild()
if in_guild then
    local members = core.guild.get_members()
    for _, member in ipairs(members or {}) do
        core.log(member.name)
    end
end