<commit_before>class ChannelPermissions {
	constructor(data, channel) {

		var self = this;

		function getBit(x) {
			return ((self.packed >>> x) & 1) === 1;
		}

		this.type = data.type; //either member or role
		this.id = data.id;

		if (this.type === "member") {
			this.packed = channel.server.getMember("id", data.id).evalPerms.packed;
		} else {
			this.packed = channel.server.getRole("id", data.id).packed;
		}

		this.packed = this.packed & ~data.deny;
		this.packed = this.packed | data.allow;

		this.deny = data.deny;
		this.allow = data.allow;

	}

	serialise() {
		return {
			createInstantInvite: this.createInstantInvite,
			manageRoles: this.manageRoles,
			manageChannels: this.manageChannels,
			readMessages: this.readMessages,
			sendMessages: this.sendMessage,
			sendTTSMessages: this.sendTTSMessages,
			manageMessages: this.manageMessages,
			embedLinks: this.embedLinks,
			attachFiles: this.attachFiles,
			readMessageHistory: this.readMessageHistory,
			mentionEveryone: this.mentionEveryone,
			voiceConnect: this.voiceConnect,
			voiceSpeak: this.voiceSpeak,
			voiceMuteMembers: this.voiceMuteMembers,
			voiceDeafenMembers: this.voiceDeafenMembers,
			voiceMoveMember: this.voiceMoveMembers,
			voiceUseVoiceActivation: this.voiceUseVoiceActivation
		}
	}
	
	serialize(){
		return this.serialise();
	}

	get asAllowDisallow() {

		var allow = 0, disallow = 0;

		function ad(value, position) {
			if (value) {
				allow |= (1 << position);
			} else {
				disallow |= (1 << position);
			}
		}<commit_msg>Fix ChannelPermissions.serialise()<commit_after>class ChannelPermissions {
	constructor(data, channel) {

		var self = this;

		function getBit(x) {
			return ((self.packed >>> x) & 1) === 1;
		}

		this.type = data.type; //either member or role
		this.id = data.id;

		if (this.type === "member") {
			this.packed = channel.server.getMember("id", data.id).evalPerms.packed;
		} else {
			this.packed = channel.server.getRole("id", data.id).packed;
		}

		this.packed = this.packed & ~data.deny;
		this.packed = this.packed | data.allow;

		this.deny = data.deny;
		this.allow = data.allow;

	}

	serialise() {
		return {
			createInstantInvite: this.createInstantInvite,
			manageRoles: this.manageRoles,
			manageChannels: this.manageChannels,
			readMessages: this.readMessages,
			sendMessages: this.sendMessages,
			sendTTSMessages: this.sendTTSMessages,
			manageMessages: this.manageMessages,
			embedLinks: this.embedLinks,
			attachFiles: this.attachFiles,
			readMessageHistory: this.readMessageHistory,
			mentionEveryone: this.mentionEveryone,
			voiceConnect: this.voiceConnect,
			voiceSpeak: this.voiceSpeak,
			voiceMuteMembers: this.voiceMuteMembers,
			voiceDeafenMembers: this.voiceDeafenMembers,
			voiceMoveMember: this.voiceMoveMembers,
			voiceUseVoiceActivation: this.voiceUseVoiceActivation
		}
	}
	
	serialize(){
		return this.serialise();
	}

	get asAllowDisallow() {

		var allow = 0, disallow = 0;

		function ad(value, position) {
			if (value) {
				allow |= (1 << position);
			} else {
				disallow |= (1 << position);
			}
		}
{'fraction_non_alphanumeric': 0.12491930277598451, 'fraction_numerical': 0.003873466752743706, 'mean_word_length': 3.8046511627906976, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3188303', 'n_tokens_mistral': 1219, 'n_tokens_neox': 1020, 'n_words': 201}