public function acceptInvite($invite)
    {
        if (preg_match('/https:\/\/discord.gg\/(.+)/', $invite, $matches)) {
            $invite = $matches[1];
        }

        $response = $this->discord->request(
            'POST',
            $this->discord->getInviteEndpoint($invite),
            $this->token
        );

        return $this->discord->buildPart(Invite::class, $this->token, $response);
    }
public function acceptInvite($invite)
    {
        if (preg_match('/https:\/\/discord.gg\/(.+)/', $invite, $matches)) {
            $invite = $matches[1];
        }

        $response = $this->discord->request(
            'POST',
            $this->discord->getInviteEndpoint($invite),
            $this->token
        );

        return $this->discord->buildPart(Invite::class, $this->token, $response);
    }
public function acceptInvite ( $ invite ) { if ( preg_match ( '/https:\/\/discord.gg\/(.+)/' , $ invite , $ matches ) ) { $ invite = $ matches [ 1 ] ; } $ response = $ this -> discord -> request ( 'POST' , $ this -> discord -> getInviteEndpoint ( $ invite ) , $ this -> token ) ; return $ this -> discord -> buildPart ( Invite :: class , $ this -> token , $ response ) ; }
Accepts an invite.

@param string $invite The invite code or URL.

@return Invite Accepted invite.
Accepts an invite .