Something to get me started on setting up Telegram with the API?

I’m a beginner at coding and am trying to figure out how to setup GPT-3 with Telegram so I can try it out as a chatbot on there. I’ve successfully made a regular rule based Telegram bot, but I don’t understand how to implement the basic code from the playground alongside Telegram’s API, input/output code etc.

Anyone who can help me get started?

Hi @joachim.sallstrom,

In the past I’ve used https://telegraf.js.org/ to make Telegram bots. You can just put GPT-3 responses in ctx.reply()

Thanks for helping!

That’s JavaScript on the Telegraf site, yes? I don’t know JavaScript, it’s just Python I’m using now.

About ctx.reply(), how do I implement it since the responses are coming through the API? What do I put in the ()?

Hi again! Did you see my question above?

ah, sorry I don’t know if Telegraf has a Python library, but the concept is that you take the result from completion openai.Completion.create(prompt=your_prompt) and pass it into whatever library you use to send Telegram messages

Edit:

how to implement the basic code from the playground

You can also get the code from the playground using the View Code button