GS2-Guild Script Trigger Reference
Trigger
createGuild
Creating guild
Synchronous Execution Script
The script is executed synchronously before the creating guild process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| guildModel | GuildModel | Guild Model |
| guild | Guild | Guild |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| guildModel | GuildModel | Guild Model |
| guild | Guild | Guild |
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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| guildModel | GuildModel | Guild Model |
| oldGuild | Guild | Guild before update |
| newGuild | Guild | Guild after update |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| guildModel | GuildModel | Guild Model |
| oldGuild | Guild | Guild before update |
| newGuild | Guild | Guild 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| guildModel | GuildModel | Guild Model |
| guild | Guild | Guild |
| userId | string | User ID |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| guildModel | GuildModel | Guild Model |
| guild | Guild | Guild |
| userId | string | User 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| guildModel | GuildModel | Guild Model |
| guild | Guild | Guild |
| userId | string | User ID |
| self | bool | Whether the user left the guild themselves or was removed by the guild master, or if the guild was disbanded |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| guildModel | GuildModel | Guild Model |
| guild | Guild | Guild |
| userId | string | User ID |
| self | bool | Whether 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| guildModel | GuildModel | Guild Model |
| guild | Guild | Guild |
| oldMembers | Member[] | Old Member Information |
| newMembers | Member[] | New Member Information |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| guildModel | GuildModel | Guild Model |
| guild | Guild | Guild |
| oldMembers | Member[] | Old Member Information |
| newMembers | Member[] | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| guildModel | GuildModel | Guild Model |
| guild | Guild | Guild |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| guildModel | GuildModel | Guild Model |
| guild | Guild | Guild |
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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| guildModel | GuildModel | Guild Model |
| guild | Guild | Guild |
| receiveMemberRequest | ReceiveMemberRequest | Join Request |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| guildModel | GuildModel | Guild Model |
| guild | Guild | Guild |
| receiveMemberRequest | ReceiveMemberRequest | Join 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 = {
}