GS2-Guild Script Trigger Reference

Reference of event triggers that call extended scripts

Trigger

createGuild

Creating guild

Synchronous Execution Script

The script is executed synchronously before the creating guild process.

Request
TypeDescription
namespaceNamespaceNamespace
guildModelGuildModelGuild Model
guildGuildGuild
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow creating guild
Implementation Example
-- Request
local namespace = args.namespace
local guildModel = args.guildModel
local guild = args.guild

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the creating guild process.

Request
TypeDescription
namespaceNamespaceNamespace
guildModelGuildModelGuild Model
guildGuildGuild
Implementation Example
-- Request
local namespace = args.namespace
local guildModel = args.guildModel
local guild = args.guild

-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.

result = {
}

updateGuild

Update guild

Synchronous Execution Script

The script is executed synchronously before the update guild process.

Request
TypeDescription
namespaceNamespaceNamespace
guildModelGuildModelGuild Model
oldGuildGuildGuild before update
newGuildGuildGuild after update
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow update guild
Implementation Example
-- Request
local namespace = args.namespace
local guildModel = args.guildModel
local oldGuild = args.oldGuild
local newGuild = args.newGuild

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the update guild process.

Request
TypeDescription
namespaceNamespaceNamespace
guildModelGuildModelGuild Model
oldGuildGuildGuild before update
newGuildGuildGuild after update
Implementation Example
-- Request
local namespace = args.namespace
local guildModel = args.guildModel
local oldGuild = args.oldGuild
local newGuild = args.newGuild

-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.

result = {
}

joinGuild

Join guild

Synchronous Execution Script

The script is executed synchronously before the join guild process.

Request
TypeDescription
namespaceNamespaceNamespace
guildModelGuildModelGuild Model
guildGuildGuild
userIdstringUser ID
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow join guild
Implementation Example
-- Request
local namespace = args.namespace
local guildModel = args.guildModel
local guild = args.guild
local userId = args.userId

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the join guild process.

Request
TypeDescription
namespaceNamespaceNamespace
guildModelGuildModelGuild Model
guildGuildGuild
userIdstringUser ID
Implementation Example
-- Request
local namespace = args.namespace
local guildModel = args.guildModel
local guild = args.guild
local userId = args.userId

-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.

result = {
}

leaveGuild

Leave guild

Synchronous Execution Script

The script is executed synchronously before the leave guild process.

Request
TypeDescription
namespaceNamespaceNamespace
guildModelGuildModelGuild Model
guildGuildGuild
userIdstringUser ID
selfboolWhether the user left the guild themselves or was removed by the guild master, or if the guild was disbanded
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow leave guild
Implementation Example
-- Request
local namespace = args.namespace
local guildModel = args.guildModel
local guild = args.guild
local userId = args.userId
local self = args.self

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the leave guild process.

Request
TypeDescription
namespaceNamespaceNamespace
guildModelGuildModelGuild Model
guildGuildGuild
userIdstringUser ID
selfboolWhether the user left the guild themselves or was removed by the guild master, or if the guild was disbanded
Implementation Example
-- Request
local namespace = args.namespace
local guildModel = args.guildModel
local guild = args.guild
local userId = args.userId
local self = args.self

-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.

result = {
}

changeRole

Change role

Synchronous Execution Script

The script is executed synchronously before the change role process.

Request
TypeDescription
namespaceNamespaceNamespace
guildModelGuildModelGuild Model
guildGuildGuild
oldMembersMember[]Old Member Information
newMembersMember[]New Member Information
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow change role
Implementation Example
-- Request
local namespace = args.namespace
local guildModel = args.guildModel
local guild = args.guild
local oldMembers = args.oldMembers
local newMembers = args.newMembers

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the change role process.

Request
TypeDescription
namespaceNamespaceNamespace
guildModelGuildModelGuild Model
guildGuildGuild
oldMembersMember[]Old Member Information
newMembersMember[]New Member Information
Implementation Example
-- Request
local namespace = args.namespace
local guildModel = args.guildModel
local guild = args.guild
local oldMembers = args.oldMembers
local newMembers = args.newMembers

-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.

result = {
}

deleteGuild

Delete Guild

Synchronous Execution Script

The script is executed synchronously before the delete guild process.

Request
TypeDescription
namespaceNamespaceNamespace
guildModelGuildModelGuild Model
guildGuildGuild
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow delete guild
Implementation Example
-- Request
local namespace = args.namespace
local guildModel = args.guildModel
local guild = args.guild

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the delete guild process.

Request
TypeDescription
namespaceNamespaceNamespace
guildModelGuildModelGuild Model
guildGuildGuild
Implementation Example
-- Request
local namespace = args.namespace
local guildModel = args.guildModel
local guild = args.guild

-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.

result = {
}

receiveJoinRequest

Receive join request

Synchronous Execution Script

The script is executed synchronously before the receive join request process.

Request
TypeDescription
namespaceNamespaceNamespace
guildModelGuildModelGuild Model
guildGuildGuild
receiveMemberRequestReceiveMemberRequestJoin Request
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow receive join request
Implementation Example
-- Request
local namespace = args.namespace
local guildModel = args.guildModel
local guild = args.guild
local receiveMemberRequest = args.receiveMemberRequest

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the receive join request process.

Request
TypeDescription
namespaceNamespaceNamespace
guildModelGuildModelGuild Model
guildGuildGuild
receiveMemberRequestReceiveMemberRequestJoin Request
Implementation Example
-- Request
local namespace = args.namespace
local guildModel = args.guildModel
local guild = args.guild
local receiveMemberRequest = args.receiveMemberRequest

-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.

result = {
}