> For the complete documentation index, see [llms.txt](/llms.txt)

# GS2-Friend スクリプト トリガー リファレンス

拡張スクリプトを呼び出すイベントトリガーのリファレンス



## トリガー

### updateProfile

プロフィールの更新
**関連するメソッド:**
updateProfile - プロフィールを更新


#### 同期実行スクリプト

プロフィールの更新処理の前に、スクリプトが同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| profile | [Profile](../sdk/#profile) | プロフィール |
| oldProfile | [Profile](../sdk/#profile) | 更新前のプロフィール |
| publicProfile | string | 新しい公開されるプロフィール |
| followerProfile | string | 新しいフォロワー向けに公開されるプロフィール |
| friendProfile | string | 新しいフレンド向けに公開されるプロフィール |

##### Result

|  | 型 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | プロフィールの更新 を許可するか |

##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local profile = args.profile
local oldProfile = args.oldProfile
local publicProfile = args.publicProfile
local followerProfile = args.followerProfile
local friendProfile = args.friendProfile

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}
```


#### 非同期実行スクリプト

プロフィールの更新処理の後に、スクリプトが非同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| oldProfile | [Profile](../sdk/#profile) | 更新前のプロフィール |
| profile | [Profile](../sdk/#profile) | 更新後のプロフィール |


##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local oldProfile = args.oldProfile
local profile = args.profile

-- 非同期スクリプトは通常、API のレスポンスには影響を与えません。
-- ログ出力や分析、外部通知などに使用します。

result = {
}
```


---
  
### follow

フォロー
**関連するメソッド:**
follow - ユーザーをフォロー


#### 同期実行スクリプト

フォロー処理の前に、スクリプトが同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| followUser | [FollowUser](../sdk/#followuser) | フォロー情報 |

##### Result

|  | 型 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | フォロー を許可するか |

##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local followUser = args.followUser

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}
```


#### 非同期実行スクリプト

フォロー処理の後に、スクリプトが非同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| followUser | [FollowUser](../sdk/#followuser) | フォロー情報 |


##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local followUser = args.followUser

-- 非同期スクリプトは通常、API のレスポンスには影響を与えません。
-- ログ出力や分析、外部通知などに使用します。

result = {
}
```


---
  
### unfollow

アンフォロー
**関連するメソッド:**
unfollow - ユーザーのフォローを解除


#### 同期実行スクリプト

アンフォロー処理の前に、スクリプトが同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| followUser | [FollowUser](../sdk/#followuser) | フォロー情報 |

##### Result

|  | 型 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | アンフォロー を許可するか |

##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local followUser = args.followUser

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}
```


#### 非同期実行スクリプト

アンフォロー処理の後に、スクリプトが非同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| followUser | [FollowUser](../sdk/#followuser) | フォロー情報 |


##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local followUser = args.followUser

-- 非同期スクリプトは通常、API のレスポンスには影響を与えません。
-- ログ出力や分析、外部通知などに使用します。

result = {
}
```


---
  
### deleteFriend

フレンドを削除
**関連するメソッド:**
deleteFriend - フレンドを削除


#### 同期実行スクリプト

フレンドを削除処理の前に、スクリプトが同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| userId | string | ユーザーID |
| friendUser | [FriendUser](../sdk/#frienduser) | フレンド |

##### Result

|  | 型 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | フレンドの削除 を許可するか |

##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local userId = args.userId
local friendUser = args.friendUser

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}
```


#### 非同期実行スクリプト

フレンドを削除処理の後に、スクリプトが非同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| userId | string | ユーザーID |
| friendUser | [FriendUser](../sdk/#frienduser) | フレンド |


##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local userId = args.userId
local friendUser = args.friendUser

-- 非同期スクリプトは通常、API のレスポンスには影響を与えません。
-- ログ出力や分析、外部通知などに使用します。

result = {
}
```


---
  
### sendRequest

フレンドリクエスト発行
**関連するメソッド:**
sendRequest - フレンドリクエストを送信


#### 同期実行スクリプト

フレンドリクエスト発行処理の前に、スクリプトが同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| friendRequest | [FriendRequest](../sdk/#friendrequest) | フレンドリクエスト |

##### Result

|  | 型 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | フレンドリクエストの発行 を許可するか |

##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local friendRequest = args.friendRequest

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}
```


#### 非同期実行スクリプト

フレンドリクエスト発行処理の後に、スクリプトが非同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| friendRequest | [FriendRequest](../sdk/#friendrequest) | フレンドリクエスト |


##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local friendRequest = args.friendRequest

-- 非同期スクリプトは通常、API のレスポンスには影響を与えません。
-- ログ出力や分析、外部通知などに使用します。

result = {
}
```


---
  
### cancelRequest

フレンドリクエストのキャンセル

#### 同期実行スクリプト

フレンドリクエストのキャンセル処理の前に、スクリプトが同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| friendRequest | [FriendRequest](../sdk/#friendrequest) | フレンドリクエスト |

##### Result

|  | 型 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | フレンドリクエストのキャンセル を許可するか |

##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local friendRequest = args.friendRequest

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}
```


#### 非同期実行スクリプト

フレンドリクエストのキャンセル処理の後に、スクリプトが非同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| friendRequest | [FriendRequest](../sdk/#friendrequest) | フレンドリクエスト |


##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local friendRequest = args.friendRequest

-- 非同期スクリプトは通常、API のレスポンスには影響を与えません。
-- ログ出力や分析、外部通知などに使用します。

result = {
}
```


---
  
### acceptRequest

フレンドリクエストの承諾
**関連するメソッド:**
acceptRequest - フレンドリクエストを承諾


#### 同期実行スクリプト

フレンドリクエストの承諾処理の前に、スクリプトが同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| friendRequest | [FriendRequest](../sdk/#friendrequest) | フレンドリクエスト |

##### Result

|  | 型 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | フレンドリクエストの承諾 を許可するか |

##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local friendRequest = args.friendRequest

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}
```


#### 非同期実行スクリプト

フレンドリクエストの承諾処理の後に、スクリプトが非同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| friendRequest | [FriendRequest](../sdk/#friendrequest) | フレンドリクエスト |


##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local friendRequest = args.friendRequest

-- 非同期スクリプトは通常、API のレスポンスには影響を与えません。
-- ログ出力や分析、外部通知などに使用します。

result = {
}
```


---
  
### rejectRequest

フレンドリクエストの拒否
**関連するメソッド:**
rejectRequest - フレンドリクエストを拒否


#### 同期実行スクリプト

フレンドリクエストの拒否処理の前に、スクリプトが同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| friendRequest | [FriendRequest](../sdk/#friendrequest) | フレンドリクエスト |

##### Result

|  | 型 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | フレンドリクエストの拒否 を許可するか |

##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local friendRequest = args.friendRequest

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}
```


#### 非同期実行スクリプト

フレンドリクエストの拒否処理の後に、スクリプトが非同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| friendRequest | [FriendRequest](../sdk/#friendrequest) | フレンドリクエスト |


##### 実装例


**Lua**
```lua

-- Request
local namespace = args.namespace
local friendRequest = args.friendRequest

-- 非同期スクリプトは通常、API のレスポンスには影響を与えません。
-- ログ出力や分析、外部通知などに使用します。

result = {
}
```


---
  



