run prettier

This commit is contained in:
dank074
2024-11-19 14:19:40 -06:00
parent 93219757a6
commit f5d6394c38
14 changed files with 157 additions and 128 deletions
+1 -1
View File
@@ -323,7 +323,7 @@ export class Channel extends BaseClass {
event: "CHANNEL_CREATE",
data: channel,
guild_id: channel.guild_id,
} as ChannelCreateEvent)
} as ChannelCreateEvent)
: Promise.resolve(),
Guild.insertChannelInOrder(guild.id, ret.id, position, guild),
]);
+16 -12
View File
@@ -132,18 +132,22 @@ export class Permissions extends BitField {
init?: bigint,
) {
// TODO: do not deny any permissions if admin
return overwrites.reduce((permission, overwrite) => {
// apply disallowed permission
// * permission: current calculated permission (e.g. 010)
// * deny contains all denied permissions (e.g. 011)
// * allow contains all explicitly allowed permisions (e.g. 100)
return (
(permission & ~BigInt(overwrite.deny)) | BigInt(overwrite.allow)
);
// ~ operator inverts deny (e.g. 011 -> 100)
// & operator only allows 1 for both ~deny and permission (e.g. 010 & 100 -> 000)
// | operators adds both together (e.g. 000 + 100 -> 100)
}, init || BigInt(0));
return overwrites.reduce(
(permission, overwrite) => {
// apply disallowed permission
// * permission: current calculated permission (e.g. 010)
// * deny contains all denied permissions (e.g. 011)
// * allow contains all explicitly allowed permisions (e.g. 100)
return (
(permission & ~BigInt(overwrite.deny)) |
BigInt(overwrite.allow)
);
// ~ operator inverts deny (e.g. 011 -> 100)
// & operator only allows 1 for both ~deny and permission (e.g. 010 & 100 -> 000)
// | operators adds both together (e.g. 000 + 100 -> 100)
},
init || BigInt(0),
);
}
static rolePermission(roles: Role[]) {