mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
Permission documentation
This commit is contained in:
@@ -77,4 +77,76 @@ serialize()
|
|||||||
|
|
||||||
**Aliases** : *serialise()*
|
**Aliases** : *serialise()*
|
||||||
|
|
||||||
To get a valid `Object` of the actual permissions of the object, just do `serverPermissions.serialise()` to get an object with the above mentioned permissions
|
To get a valid `Object` of the actual permissions of the object, just do `serverPermissions.serialise()` to get an object with the above mentioned permissions
|
||||||
|
|
||||||
|
ChannelPermissions
|
||||||
|
------------------
|
||||||
|
|
||||||
|
ChannelPermissions are based from a ServerPermissions object (although not actually extending them, none of the Permissions objects extend each other). It represents an override/overwrite of a server permission.
|
||||||
|
|
||||||
|
Actual Permissions:
|
||||||
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
{
|
||||||
|
createInstantInvite,
|
||||||
|
manageRoles,
|
||||||
|
manageChannels,
|
||||||
|
readMessages,
|
||||||
|
sendMessages,
|
||||||
|
sendTTSMessages,
|
||||||
|
manageMessages,
|
||||||
|
embedLinks,
|
||||||
|
attachFiles,
|
||||||
|
readMessageHistory,
|
||||||
|
mentionEveryone,
|
||||||
|
voiceConnect,
|
||||||
|
voiceSpeak,
|
||||||
|
voiceMuteMembers,
|
||||||
|
voiceDeafenMembers,
|
||||||
|
voiceMoveMember,
|
||||||
|
voiceUseVoiceActivation
|
||||||
|
}
|
||||||
|
|
||||||
|
serialize()
|
||||||
|
~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Aliases** : *serialise()*
|
||||||
|
|
||||||
|
To get a valid `Object` of the actual permissions of the object, just do `channelPermissions.serialise()` to get an object with the above mentioned permissions
|
||||||
|
|
||||||
|
EvaluatedPermissions
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
EvaluatedPermissions represents the permissions of a user in a channel, taking into account all roles and overwrites active on them; an evaluation of their permissions.
|
||||||
|
|
||||||
|
Actual Permissions:
|
||||||
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
EvaluatedPermissions has the same permissions as ChannelPermissions.
|
||||||
|
|
||||||
|
{
|
||||||
|
createInstantInvite,
|
||||||
|
manageRoles,
|
||||||
|
manageChannels,
|
||||||
|
readMessages,
|
||||||
|
sendMessages,
|
||||||
|
sendTTSMessages,
|
||||||
|
manageMessages,
|
||||||
|
embedLinks,
|
||||||
|
attachFiles,
|
||||||
|
readMessageHistory,
|
||||||
|
mentionEveryone,
|
||||||
|
voiceConnect,
|
||||||
|
voiceSpeak,
|
||||||
|
voiceMuteMembers,
|
||||||
|
voiceDeafenMembers,
|
||||||
|
voiceMoveMember,
|
||||||
|
voiceUseVoiceActivation
|
||||||
|
}
|
||||||
|
|
||||||
|
serialize()
|
||||||
|
~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Aliases** : *serialise()*
|
||||||
|
|
||||||
|
To get a valid `Object` of the actual permissions of the object, just do `channelPermissions.serialise()` to get an object with the above mentioned permissions
|
||||||
@@ -37,6 +37,7 @@ Contents:
|
|||||||
docs_pmchannel
|
docs_pmchannel
|
||||||
docs_message
|
docs_message
|
||||||
docs_invite
|
docs_invite
|
||||||
|
docs_permissions
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ var ChannelPermissions = (function () {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ChannelPermissions.prototype.serialize = function serialize() {
|
||||||
|
return this.serialise();
|
||||||
|
};
|
||||||
|
|
||||||
ChannelPermissions.prototype.getBit = function getBit(x) {
|
ChannelPermissions.prototype.getBit = function getBit(x) {
|
||||||
if ((this.packed >>> 3 & 1) === 1) {
|
if ((this.packed >>> 3 & 1) === 1) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ class ChannelPermissions {
|
|||||||
voiceUseVoiceActivation: this.voiceUseVoiceActivation
|
voiceUseVoiceActivation: this.voiceUseVoiceActivation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
serialize(){
|
||||||
|
return this.serialise();
|
||||||
|
}
|
||||||
|
|
||||||
get asAllowDisallow() {
|
get asAllowDisallow() {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user