GS2-Chat Script トリガー リファレンス
拡張スクリプトを呼び出す イベントトリガー のリファレンス
トリガー
createRoom
ルーム作成
同期実行スクリプト
ルーム作成処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| room | Room | ルーム |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | ルーム作成を許可するか |
実装例
-- Request
local namespace = args.namespace
local room = args.room
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}非同期実行スクリプト
ルーム作成処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| room | Room | ルーム |
実装例
-- Request
local namespace = args.namespace
local room = args.room
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}deleteRoom
ルーム削除
同期実行スクリプト
ルーム削除処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| room | Room | ルーム |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | ルーム削除を許可するか |
実装例
-- Request
local namespace = args.namespace
local room = args.room
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}非同期実行スクリプト
ルーム削除処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| room | Room | ルーム |
実装例
-- Request
local namespace = args.namespace
local room = args.room
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}postMessage
メッセージ投稿
同期実行スクリプト
メッセージ投稿処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| room | Room | ルーム |
| message | Message | メッセージ |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | メッセージ投稿を許可するか |
実装例
-- Request
local namespace = args.namespace
local room = args.room
local message = args.message
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}非同期実行スクリプト
メッセージ投稿処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| room | Room | ルーム |
| message | Message | メッセージ |
実装例
-- Request
local namespace = args.namespace
local room = args.room
local message = args.message
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}subscribeRoom
ルーム購読
同期実行スクリプト
ルーム購読処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| room | Room | ルーム |
| subscribe | Subscribe | 購読 |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | ルーム購読を許可するか |
実装例
-- Request
local namespace = args.namespace
local room = args.room
local subscribe = args.subscribe
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}非同期実行スクリプト
ルーム購読処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| room | Room | ルーム |
| subscribe | Subscribe | 購読 |
実装例
-- Request
local namespace = args.namespace
local room = args.room
local subscribe = args.subscribe
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}unsubscribeRoom
ルーム購読解除
同期実行スクリプト
ルーム購読解除処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| room | Room | ルーム |
| subscribe | Subscribe | 購読 |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | ルーム購読解除を許可するか |
実装例
-- Request
local namespace = args.namespace
local room = args.room
local subscribe = args.subscribe
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}非同期実行スクリプト
ルーム購読解除処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| room | Room | ルーム |
| subscribe | Subscribe | 購読 |
実装例
-- Request
local namespace = args.namespace
local room = args.room
local subscribe = args.subscribe
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}