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

deploy.ts: Uses Deno.serve() instead of fetch event listener #361

Merged
merged 5 commits into from
Aug 19, 2023
Merged

deploy.ts: Uses Deno.serve() instead of fetch event listener #361

merged 5 commits into from
Aug 19, 2023

Conversation

MostProDev
Copy link
Contributor

@MostProDev MostProDev commented Aug 17, 2023

About

Deno.server() should be faster, and it supports localhost for local development.

Status

  • These changes have been tested against Discord API or do not contain API change.
  • This PR includes only documentation changes, no code change.
  • This PR introduces some Breaking changes.

deploy.ts Outdated
Comment on lines 89 to 92
await client._process(interaction);
return new Response('Error', {
status: 500
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this returning error (after processing interaction)? It should be 200 as OK or 203 as empty response

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, it only gets run if "await client.verifyFetchEvent({ request, respondWith: (res: Response) => { return res; } });" fails to return anything, and is there to avoid TS problems.

deploy.ts Outdated
)
return
const interaction = await client.verifyFetchEvent({ request, respondWith: (res: Response) => { return res; } });
if (!interaction) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This here should be interaction == false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean "interaction === false".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, fixed.

deploy.ts Outdated
export * from './src/structures/embed.ts'
export * from './src/types/messageComponents.ts'
alfiecrawford@Alfies-Air harmony-main % npx prettier deploy.ts -o output.txt
[warn] Ignored unknown option -o=output.txt. Did you mean -c?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bruh

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@MostProDev MostProDev requested a review from Helloyunho August 19, 2023 12:26
Copy link
Member

@Helloyunho Helloyunho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Helloyunho Helloyunho merged commit c1992bb into harmonyland:main Aug 19, 2023
Helloyunho added a commit that referenced this pull request Aug 28, 2023
This reverts commit c1992bb, reversing
changes made to 1a21e7a.

Deno.serve doesn't work on here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants