feat(Relationships): Change enum
This commit is contained in:
@@ -126,7 +126,7 @@ class RelationshipsManager {
|
||||
*/
|
||||
cancelFriendRequest(user) {
|
||||
const id = this.resolveId(user);
|
||||
if (this.cache.get(id) !== RelationshipTypes.OUTGOING_REQUEST) return false;
|
||||
if (this.cache.get(id) !== RelationshipTypes.PENDING_OUTGOING) return false;
|
||||
return this.__cancel(id);
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ class RelationshipsManager {
|
||||
// Check if already friends
|
||||
if (this.cache.get(id) === RelationshipTypes.FRIEND) return false;
|
||||
// Check if outgoing request
|
||||
if (this.cache.get(id) === RelationshipTypes.OUTGOING_REQUEST) return false;
|
||||
if (this.cache.get(id) === RelationshipTypes.PENDING_OUTGOING) return false;
|
||||
await this.client.api.users['@me'].relationships[id].put({
|
||||
data: {
|
||||
type: RelationshipTypes.FRIEND,
|
||||
|
@@ -1481,13 +1481,21 @@ exports.GuildScheduledEventPrivacyLevels = createEnum([null, null, 'GUILD_ONLY']
|
||||
* * 0: NONE
|
||||
* * 1: FRIEND
|
||||
* * 2: BLOCKED
|
||||
* * 3: INCOMING_REQUEST
|
||||
* * 4: OUTGOING_REQUEST
|
||||
* * 3: PENDING_INCOMING
|
||||
* * 4: PENDING_OUTGOING
|
||||
* * 5: IMPLICIT
|
||||
* @typedef {string} RelationshipTypes
|
||||
* @see {@link https://luna.gitlab.io/discord-unofficial-docs/relationships.html}
|
||||
*/
|
||||
|
||||
exports.RelationshipTypes = createEnum(['NONE', 'FRIEND', 'BLOCKED', 'INCOMING_REQUEST', 'OUTGOING_REQUEST']);
|
||||
exports.RelationshipTypes = createEnum([
|
||||
'NONE',
|
||||
'FRIEND',
|
||||
'BLOCKED',
|
||||
'PENDING_INCOMING',
|
||||
'PENDING_OUTGOING',
|
||||
'IMPLICIT',
|
||||
]);
|
||||
|
||||
/**
|
||||
* The premium tier (Server Boost level) of a guild:
|
||||
|
Reference in New Issue
Block a user