Skip to content
This repository has been archived by the owner on Feb 14, 2022. It is now read-only.

Leaving a server doesn't work. #30

Open
real2two opened this issue Sep 10, 2021 · 0 comments
Open

Leaving a server doesn't work. #30

real2two opened this issue Sep 10, 2021 · 0 comments

Comments

@real2two
Copy link
Contributor

Please describe the bug or issue in as much detail as possible:
The leave function doesn't work, because the ID is set as undefined.

Please include a reproducible code sample here, if possible:

client.houses.leave("house id");

Further details:

  • Installed hiven.js version: ^2.0.11
  • Installed Node.js version: v14.17.0
  • Operating system: Windows 10

Workaround

I've set the leave() function on https://github.com/hivenapp/hiven.js/blob/master/lib/Collections/House.ts to have a parameter called id and then changed this.id on the rest.delete() function to id.

From

    leave() {
        return __awaiter(this, void 0, void 0, function* () {
            // Leave the house
            const leaveHouse = yield Client_1.rest.delete(`/users/@me/houses/${this.id}`);
            return leaveHouse;
        });
    }

to

    leave(id) {
        return __awaiter(this, void 0, void 0, function* () {
            // Leave the house
            const leaveHouse = yield Client_1.rest.delete(`/users/@me/houses/${id}`);
            return leaveHouse;
        });
    }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant