revolt.js
Advanced tools
Comparing version 6.0.0-rc.28 to 6.0.0
@@ -1,2 +0,2 @@ | ||
export declare const LIBRARY_VERSION = "6.0.0-rc.26"; | ||
export declare const LIBRARY_VERSION = "6.0.0"; | ||
export declare const defaultConfig: { | ||
@@ -3,0 +3,0 @@ apiURL: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.defaultConfig = exports.LIBRARY_VERSION = void 0; | ||
exports.LIBRARY_VERSION = "6.0.0-rc.26"; | ||
exports.LIBRARY_VERSION = "6.0.0"; | ||
exports.defaultConfig = { | ||
@@ -6,0 +6,0 @@ apiURL: "https://api.revolt.chat", |
@@ -21,2 +21,14 @@ import type { DataMemberEdit, FieldsMember, Member as MemberI, MemberCompositeKey } from "revolt-api"; | ||
get server(): Server | undefined; | ||
/** | ||
* Whether the client has a higher rank than this member. | ||
*/ | ||
get inferior(): boolean; | ||
/** | ||
* Whether the client can kick this user. | ||
*/ | ||
get kickable(): boolean | undefined; | ||
/** | ||
* Whether the client can ban this user. | ||
*/ | ||
get bannable(): boolean | undefined; | ||
constructor(client: Client, data: MemberI); | ||
@@ -120,2 +132,8 @@ update(data: Partial<MemberI>, clear?: FieldsMember[]): void; | ||
hasPermission(target: Server | Channel, ...permission: (keyof typeof Permission)[]): boolean; | ||
/** | ||
* Checks whether the target member has a higher rank than this member. | ||
* @param target The member to compare against | ||
* @returns Whether this member is inferior to the target | ||
*/ | ||
inferiorTo(target: Member): boolean; | ||
} | ||
@@ -122,0 +140,0 @@ export default class Members extends Collection<string, Member> { |
@@ -55,2 +55,23 @@ "use strict"; | ||
} | ||
/** | ||
* Whether the client has a higher rank than this member. | ||
*/ | ||
get inferior() { | ||
var _a, _b, _c; | ||
return ((_c = (_b = (_a = this.server) === null || _a === void 0 ? void 0 : _a.member) === null || _b === void 0 ? void 0 : _b.ranking) !== null && _c !== void 0 ? _c : Infinity) < this.ranking; | ||
} | ||
/** | ||
* Whether the client can kick this user. | ||
*/ | ||
get kickable() { | ||
var _a; | ||
return ((_a = this.server) === null || _a === void 0 ? void 0 : _a.havePermission('KickMembers')) && this.inferior; | ||
} | ||
/** | ||
* Whether the client can ban this user. | ||
*/ | ||
get bannable() { | ||
var _a; | ||
return ((_a = this.server) === null || _a === void 0 ? void 0 : _a.havePermission('BanMembers')) && this.inferior; | ||
} | ||
update(data, clear = []) { | ||
@@ -168,2 +189,10 @@ const apply = (key) => { | ||
} | ||
/** | ||
* Checks whether the target member has a higher rank than this member. | ||
* @param target The member to compare against | ||
* @returns Whether this member is inferior to the target | ||
*/ | ||
inferiorTo(target) { | ||
return target.ranking < this.ranking; | ||
} | ||
} | ||
@@ -191,2 +220,5 @@ __decorate([ | ||
], Member.prototype, "hasPermission", null); | ||
__decorate([ | ||
mobx_1.computed | ||
], Member.prototype, "inferiorTo", null); | ||
exports.Member = Member; | ||
@@ -193,0 +225,0 @@ class Members extends Collection_1.default { |
@@ -1,2 +0,2 @@ | ||
export declare const LIBRARY_VERSION = "6.0.0-rc.26"; | ||
export declare const LIBRARY_VERSION = "6.0.0"; | ||
export declare const defaultConfig: { | ||
@@ -3,0 +3,0 @@ apiURL: string; |
@@ -1,2 +0,2 @@ | ||
export const LIBRARY_VERSION = "6.0.0-rc.26"; | ||
export const LIBRARY_VERSION = "6.0.0"; | ||
export const defaultConfig = { | ||
@@ -3,0 +3,0 @@ apiURL: "https://api.revolt.chat", |
@@ -21,2 +21,14 @@ import type { DataMemberEdit, FieldsMember, Member as MemberI, MemberCompositeKey } from "revolt-api"; | ||
get server(): Server | undefined; | ||
/** | ||
* Whether the client has a higher rank than this member. | ||
*/ | ||
get inferior(): boolean; | ||
/** | ||
* Whether the client can kick this user. | ||
*/ | ||
get kickable(): boolean | undefined; | ||
/** | ||
* Whether the client can ban this user. | ||
*/ | ||
get bannable(): boolean | undefined; | ||
constructor(client: Client, data: MemberI); | ||
@@ -120,2 +132,8 @@ update(data: Partial<MemberI>, clear?: FieldsMember[]): void; | ||
hasPermission(target: Server | Channel, ...permission: (keyof typeof Permission)[]): boolean; | ||
/** | ||
* Checks whether the target member has a higher rank than this member. | ||
* @param target The member to compare against | ||
* @returns Whether this member is inferior to the target | ||
*/ | ||
inferiorTo(target: Member): boolean; | ||
} | ||
@@ -122,0 +140,0 @@ export default class Members extends Collection<string, Member> { |
@@ -49,2 +49,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
} | ||
/** | ||
* Whether the client has a higher rank than this member. | ||
*/ | ||
get inferior() { | ||
var _a, _b, _c; | ||
return ((_c = (_b = (_a = this.server) === null || _a === void 0 ? void 0 : _a.member) === null || _b === void 0 ? void 0 : _b.ranking) !== null && _c !== void 0 ? _c : Infinity) < this.ranking; | ||
} | ||
/** | ||
* Whether the client can kick this user. | ||
*/ | ||
get kickable() { | ||
var _a; | ||
return ((_a = this.server) === null || _a === void 0 ? void 0 : _a.havePermission('KickMembers')) && this.inferior; | ||
} | ||
/** | ||
* Whether the client can ban this user. | ||
*/ | ||
get bannable() { | ||
var _a; | ||
return ((_a = this.server) === null || _a === void 0 ? void 0 : _a.havePermission('BanMembers')) && this.inferior; | ||
} | ||
update(data, clear = []) { | ||
@@ -162,2 +183,10 @@ const apply = (key) => { | ||
} | ||
/** | ||
* Checks whether the target member has a higher rank than this member. | ||
* @param target The member to compare against | ||
* @returns Whether this member is inferior to the target | ||
*/ | ||
inferiorTo(target) { | ||
return target.ranking < this.ranking; | ||
} | ||
} | ||
@@ -185,2 +214,5 @@ __decorate([ | ||
], Member.prototype, "hasPermission", null); | ||
__decorate([ | ||
computed | ||
], Member.prototype, "inferiorTo", null); | ||
export default class Members extends Collection { | ||
@@ -187,0 +219,0 @@ constructor(client) { |
{ | ||
"name": "revolt.js", | ||
"version": "6.0.0-rc.28", | ||
"version": "6.0.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
459299
12790
1