Readme

This val is a demo skeleton of a telegram chat bot.

It requires the BOT_TOKEN environment varialbe, which the telegram bot token.

Another required variable is ME. The variable is an HTTP header to call a few extra endpoints (see the code).

One of those endpoints is /webhook/set, which installs the webhook to activate the bot.

The code is mostly educational. The bot echos back incoming messages.

There is one command, /ai, which sends the incoming messages to Open AI and forwards the reply back to the chat.

Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
begoon-telegrambot.web.val.run
September 11, 2024