fnbr
Version:
A library to interact with Epic Games' Fortnite HTTP and XMPP services
36 lines • 1.42 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const BasePendingFriend_1 = tslib_1.__importDefault(require("./BasePendingFriend"));
/**
* Represents an incoming friendship request
*/
class IncomingPendingFriend extends BasePendingFriend_1.default {
constructor(client, data) {
super(client, data);
this.direction = 'INCOMING';
}
/**
* Accepts this incoming pending friend request
* @throws {UserNotFoundError} The user wasn't found
* @throws {DuplicateFriendshipError} The user is already friends with the client
* @throws {InviterFriendshipsLimitExceededError} The client's friendship limit is reached
* @throws {InviteeFriendshipsLimitExceededError} The user's friendship limit is reached
* @throws {InviteeFriendshipSettingsError} The user disabled friend requests
* @throws {EpicgamesAPIError}
*/
async accept() {
return this.client.friend.add(this.id);
}
/**
* Declines this incoming pending friend request
* @throws {UserNotFoundError} The user wasn't found
* @throws {FriendNotFoundError} The user is not friends with the client
* @throws {EpicgamesAPIError}
*/
async decline() {
return this.client.friend.remove(this.id);
}
}
exports.default = IncomingPendingFriend;
//# sourceMappingURL=IncomingPendingFriend.js.map