diff --git a/src/api/routes.ts b/src/api/routes.ts index 96a35324..2985e1e0 100644 --- a/src/api/routes.ts +++ b/src/api/routes.ts @@ -10,7 +10,7 @@ import type { SendableEmbed } from "revolt-api/types/Channels"; import type { RevoltConfiguration } from "revolt-api/types/Core"; -import type { RetrievedInvite, ServerInvite } from "revolt-api/types/Invites"; +import type { Invite, RetrievedInvite, ServerInvite } from "revolt-api/types/Invites"; import type { Ban, Category, @@ -210,7 +210,7 @@ type Routes = | { // Edit user. method: "PATCH"; - route: `/users/${Id}`; + route: `/users/@me`; data: { status?: Status; profile?: { @@ -225,7 +225,7 @@ type Routes = | { // Change username. method: "PATCH"; - route: `/users/${Id}/username`; + route: `/users/@me/username`; data: { username: string; password: string; @@ -373,7 +373,7 @@ type Routes = method: "POST"; route: `/channels/${Id}/invites`; data: undefined; - response: { code: string }; + response: Invite; } | { // Add member to group. diff --git a/src/maps/Channels.ts b/src/maps/Channels.ts index 0d3f8226..2120d473 100644 --- a/src/maps/Channels.ts +++ b/src/maps/Channels.ts @@ -566,11 +566,10 @@ export class Channel { * @returns Newly created invite code */ async createInvite() { - const res = await this.client.req( + return await this.client.req( "POST", `/channels/${this._id}/invites` as "/channels/id/invites", ); - return res.code; } /** diff --git a/src/maps/Users.ts b/src/maps/Users.ts index a0734a59..b836ad4c 100644 --- a/src/maps/Users.ts +++ b/src/maps/Users.ts @@ -291,8 +291,8 @@ export default class Users extends Collection { * Edit the current user * @param data User edit data object */ - async edit(data: Route<"PATCH", "/users/id">["data"]) { - await this.client.req("PATCH", "/users/id", data); + async edit(data: Route<"PATCH", "/users/@me">["data"]) { + await this.client.req("PATCH", "/users/@me", data); } /** @@ -301,7 +301,7 @@ export default class Users extends Collection { * @param password Current password */ async changeUsername(username: string, password: string) { - return await this.client.req("PATCH", "/users/id/username", { + return await this.client.req("PATCH", "/users/@me/username", { username, password, });