Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

HTTP method body expects Record<string, string> #23

@zaida04

Description

@zaida04

Example Code

import { RestManager } from "@cordis/rest";
import { buildRestRouter } from "@cordis/routers";

const manager = new RestManager(process.env.DISCORD_TOKEN);
const rest = buildRestRouter(manager);

await rest.channels["500765481788112916"].messages.post({
      data: {
            content: "TESTING MESSAGES",
            tts: false,
            embed: {},
      },
});

Issue

In the data object, the keys tts and embed are invalid because data is expecting only a Record<string, string>, which should be improper considering things like objects can be nested in the body and values like booleans and numbers also exist.

Potential Solution

change Record<string, string> to Record<string, any>

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions