function overwritePermissions($memberOrRole, $allow, $deny = 0, string $reason = '') {
        [ $memberOrRole, $options ] = $this->validateOverwritePermissions($memberOrRole, $allow, $deny);
        
        return (new \React\Promise\Promise(function (callable $resolve, callable $reject) use ($memberOrRole, $options, $reason) {
            $this->client->apimanager()->endpoints->channel->editChannelPermissions($this->id, $memberOrRole, $options, $reason)->done(function () use ($memberOrRole, $options, $resolve, $reject) {
                $options['id'] = $memberOrRole;
                
                if($options['type'] === 'member') {
                    $fetch = $this->guild->fetchMember($options['id']);
                } else {
                    $fetch = \React\Promise\resolve();
                }
                
                $fetch->done(function () use ($options, $resolve) {
                    if($options['allow'] instanceof \CharlotteDunois\Yasmin\Models\Permissions) {
                        $options['allow'] = $options['allow']->bitfield;
                    }
                    
                    if($options['deny'] instanceof \CharlotteDunois\Yasmin\Models\Permissions) {
                        $options['deny'] = $options['deny']->bitfield;
                    }
                    
                    $overwrite = new \CharlotteDunois\Yasmin\Models\PermissionOverwrite($this->client, $this, $options);
                    $this->permissionOverwrites->set($overwrite->id, $overwrite);
                    
                    $resolve($overwrite);
                }, $reject);
            }, $reject);
        }));
    }