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

Leaving a server doesn't work. #30

Open
@real2two

Description

@real2two

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;
        });
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions