Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index.d.ts mismatch #25

Open
wchtommy20013psa opened this issue Jul 30, 2020 · 6 comments · May be fixed by #29
Open

index.d.ts mismatch #25

wchtommy20013psa opened this issue Jul 30, 2020 · 6 comments · May be fixed by #29

Comments

@wchtommy20013psa
Copy link

wchtommy20013psa commented Jul 30, 2020

export class MessageBuilder {
      setUrl(url: string): this; 
      setColor(color: number): this;
}

should be

export class MessageBuilder {
      setURL(url: string): this; 
      setColor(color: string | number): this;
}
@arifali123
Copy link

Yes this should be correct too getting the same error

@AntoineKM
Copy link

AntoineKM commented Jul 27, 2022

if you still having this issue because the maintainer dont update this error you can do this instead it's not perfect but it's working:
image

      .setColor("#51e1e4" as any)

@AntoineKM
Copy link

you can still use this website to convert your hex color to decimal or so
https://convertingcolors.com/

@tycrek
Copy link

tycrek commented Dec 23, 2022

If you're looking for an alternative solution, see my comment in #34 (comment)

@WillNess210
Copy link

A hacky fix I am using:

interface MessageBuilderWithFix extends MessageBuilder {
  setURL: (url: string) => MessageBuilderWithFix;
}

function getEmbedBuilder(): MessageBuilderWithFix {
  return new MessageBuilder() as MessageBuilderWithFix;
}

@tycrek
Copy link

tycrek commented Jan 23, 2023

As a more production-friendly alternative, I forked and re-wrote this project here: https://github.com/tycrek/discord-hookr (note for users of this repo)

It's not a direct 1:1 replacement so I'd recommend reading my docs if you choose to go this route. Also keep in mind that file uploads are not implemented, but standard webhook embeds are fully supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants