#connecting a telegram bot to a serverless pod

48 messages · Page 1 of 1 (latest)

jagged grail
#

Hey guys, would love ur assist on the following issue,
i have a serverless function and i have an api endpoint from runpod, to which i can access using curl when providing an autorization in the http header,

the problem is when using /setWebhook when creating a telegram bot i need to provide an endpoint and i can't pass on parameters in the http request,

how should i approach this? i'd like to be able to send a message to a telegram bot that will trigger my serverless function that uses gpu

dawn umbra
#

Google how to build Telegram bots and then make an API call from your telegram bot code that you host on a VPS.

jagged grail
#

is there a way to solve this without having a private server running at all time? if somehow i could expose an api endpoint that doesn't need authonication that would be ideal

dawn umbra
#

You can use AWS Lambda or RunPod CPU serverless

#

You can't use a RunPod serverless endpoint without auth

jagged grail
#

with its sole purpose of adding the authorization to the api call? is that what everyone who connects their gpu instance to a telegram bot does?

dawn umbra
#

Why would you want to do that? Peoplc can abuse it and rack up your RunPod account, its a very bad idea

jagged grail
#

yea i guess im just setting up an initial POC, was going to worry about authorization later, allowing people to create users etc..

#

runpod cpu serverless would still need to be authorized no? its the same problem

edgy lintel
#

like the default gpu serverless

#

but for pods its more customizable

jagged grail
#

@edgy lintel is there a way to both not have a running server at all time and to be able to forward the request without authenticating?

edgy lintel
jagged grail
#

One thing that might help is if I can transfer the autorization to run pod in the url, maybe as a query parameter?

#

Not sure if that is possible

#

Telegram allows u to connect a message to a post request to a url, but u can't authenticate using an http header authorization parameter

edgy lintel
#

sure as a body, unless you're using pods you can pass it as query

#

Hm no then, serverless needs auth header

jagged grail
#

Hmm, that's strange since in the history of the chats in this discord people have created telegram bots that communicated with a serverless function, so I think I'm missing something

edgy lintel
#

Where?

dawn umbra
#

Its very easy to do it but you can't just magically run a telegram bot without infrastructure to host it.

edgy lintel
jagged grail
#

I have just searched phrases like "telegram Bot" and seen people talking about theirs connecting to a serverless function

dawn umbra
edgy lintel
#

you need an server to receive the message and act accordingly ( send request to runpod serverless )

dawn umbra
jagged grail
#

And then the lambda just adds the api key and calls run pod?

dawn umbra
#

Lambda is pretty cheap and can receive and send telegram messages and call RunPod Serverless API with the API key

edgy lintel
jagged grail
#

I guess that will work, but I was thinking if aws lambda can expose a public api then so can the runpod 🥲

dawn umbra
#

You can use AWS secrets manager for storing the API key

jagged grail
#

I guess I'll do that then, thank u guys!

dawn umbra
edgy lintel
#

Hmm what if runpod serverless allows that

#

would that be ok

dawn umbra
#

This kind of thing makes me concerned that people are going to come crying to RunPod when their balance is depleted.

#

RunPod serverless required authentication for a very good reason.

jagged grail
#

I mean if aws allows that I don't really see the difference

dawn umbra
#

AWS also lets you expose any endpoint you want, not just /run, /runsync etc

#

So you are comparing apples with lemons

edgy lintel
jagged grail
#

Aws lambda specifically does allow u to expose the public api and that's the same as runpod cpu in my eyes

#

Yea maybe only for cpu

dawn umbra
#

Incorrect, the design and architecture are completely different.

jagged grail
#

For sure behind the scenes, for they are intended for similar purposes product wise

edgy lintel
#

Feel free to write it on #1185337232517759028

#

raz