Skip to content

Commit

Permalink
Add FriendsBlock function to the runtimes.
Browse files Browse the repository at this point in the history
  • Loading branch information
zyro committed May 21, 2022
1 parent 27fe749 commit 11ae5d0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
### Added
- Add custom metrics publishing functions to Lua and JavaScript runtimes.
- Add missing "sessionLogout" TypeScript definition.
- Add "FriendsBlock" function to the runtimes.

### Changed
- Fix naming of delete notifications before/after hook registration functions.
Expand Down
11 changes: 11 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4118,6 +4118,17 @@ declare namespace nkruntime {
*/
friendsDelete(userId: string, username: string, ids: string[], usernames: string[]): FriendList;

/**
* Block friends for a user.
*
* @param userId - User ID.
* @param username - Username.
* @param ids - The IDs of the users you want to block as friends.
* @param usernames - The usernames of the users you want to block as friends.
* @throws {TypeError, GoError}
*/
friendsBlock(userId: string, username: string, ids: string[], usernames: string[]): FriendList;

/**
* Join a user to a group.
*
Expand Down
1 change: 1 addition & 0 deletions runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,7 @@ type NakamaModule interface {
FriendsList(ctx context.Context, userID string, limit int, state *int, cursor string) ([]*api.Friend, string, error)
FriendsAdd(ctx context.Context, userID string, username string, ids []string, usernames []string) error
FriendsDelete(ctx context.Context, userID string, username string, ids []string, usernames []string) error
FriendsBlock(ctx context.Context, userID string, username string, ids []string, usernames []string) error

Event(ctx context.Context, evt *api.Event) error

Expand Down

0 comments on commit 11ae5d0

Please sign in to comment.