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

Add Vercel hosting guide #543

Merged
merged 22 commits into from
Nov 21, 2022

Conversation

jgcarrillo
Copy link

@jgcarrillo jgcarrillo commented Nov 19, 2022

As I asked in the grammY Telegram group, I have recently developed a bot with grammY. This tool is amazing because it is so easy to use!

I found an example to deploy it on Vercel in the examples repository that was very helpful. I thought it would be a good idea to add a guide on Vercel in the web hosting section, so here it is!

@KnorpelSenf KnorpelSenf requested a review from rojvv November 19, 2022 16:06
@rojvv rojvv changed the title feat: add Vercel hosting guide Add Vercel hosting guide Nov 19, 2022
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
@KnorpelSenf
Copy link
Member

I wonder how many more times this will go back and forth :D

Copy link
Contributor

@quadratz quadratz left a comment

Choose a reason for hiding this comment

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

Looks good to me.

site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
@jgcarrillo
Copy link
Author

I wonder how many more times this will go back and forth :D

Sorry guys, I don't usually make many contributions to projects. Thanks for your reviews and I hope next time I make less bugs, I just wanted to do some documentation to help new people :)

Copy link
Member

@KnorpelSenf KnorpelSenf left a comment

Choose a reason for hiding this comment

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

Amazing contribution, thank you so much!

site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
@jgcarrillo
Copy link
Author

Thank you guys.

I hope to be useful in the future, I will be aware of possible PR where I can help. If necessary I can also translate this same Vercel page into Spanish.

site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
Comment on lines 111 to 114
Other useful commands are:

- Info about webhook: `https://api.telegram.org/bot{BOT_TOKEN}/getWebhookInfo`
- Delete webhook: `https://api.telegram.org/bot{BOT_TOKEN}/deleteWebhook`
Copy link
Member

@rojvv rojvv Nov 21, 2022

Choose a reason for hiding this comment

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

I think that this is

Copy link
Author

@jgcarrillo jgcarrillo Nov 21, 2022

Choose a reason for hiding this comment

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

Should I delete it?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it would be way better.

Copy link
Member

Choose a reason for hiding this comment

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

As soon as this PQ is done and merged, we should probably copy this paragraph to the other guides, as well. Not very DRY, but very useful indeed.

Copy link
Author

Choose a reason for hiding this comment

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

Done!

@KnorpelSenf
Copy link
Member

KnorpelSenf commented Nov 21, 2022

Thank you guys.

I hope to be useful in the future, I will be aware of possible PR where I can help. If necessary I can also translate this same Vercel page into Spanish.

That's amazing to hear! So far @habemuscode is the only Spanish translator and we need all the help we can get. I'll let you know when the translations are starting. Feel free to hit me up on TG at https://knorpelsenf.t.me.

site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
site/docs/hosting/vercel.md Outdated Show resolved Hide resolved
Copy link
Member

@rojvv rojvv left a comment

Choose a reason for hiding this comment

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

Looks astonishing to me, thank you soo much!

@rojvv rojvv changed the base branch from main to vercel-hosting-guide November 21, 2022 18:02
@rojvv rojvv merged commit 316cd5d into grammyjs:vercel-hosting-guide Nov 21, 2022
@@ -70,35 +70,35 @@ It should look roughly like this:
```ts
import { Bot, webhookCallback } from "grammy";

const bot = new Bot(process.env.BOT_TOKEN); // <-- insert your bot token from environment variable
const bot = new Bot(process.env.BOT_TOKEN);
Copy link
Member

Choose a reason for hiding this comment

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

I just noticed that this won't typecheck

Copy link
Member

Choose a reason for hiding this comment

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

This = the code examples?

Copy link
Member

Choose a reason for hiding this comment

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

This line. On Node, the env value may be absent but the Bot constructor requires the token.

Copy link
Author

Choose a reason for hiding this comment

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

Do you refer to this?

if (process.env.BOT_TOKEN === undefined) {
  throw new TypeError('BOT_TOKEN must be provided!');
}

const token: string = process.env.BOT_TOKEN;
const bot = new Bot(token);

Copy link
Member

Choose a reason for hiding this comment

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

@KnorpelSenf Yes, should we do something like that?^

Copy link
Member

Choose a reason for hiding this comment

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

Yes, thanks!

Just check the variable token directly ;)

rojvv added a commit that referenced this pull request Nov 29, 2022
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.

4 participants