Back to APIs list

Telegram API examples & templates

Use these vals as a playground to view and fork Telegram API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
neverstew avatar
telegramWebhookEchoMessage
@neverstew
HTTP
An interactive, runnable TypeScript val by neverstew
tarasyarema avatar
tgWebhookHandler
@tarasyarema
HTTP
An interactive, runnable TypeScript val by tarasyarema
victor141516 avatar
sendTelegramMessage
@victor141516
Script
An interactive, runnable TypeScript val by victor141516
sjmre avatar
telegramSendMessage
@sjmre
Script
An interactive, runnable TypeScript val by sjmre
hootz avatar
telegramDalleBot
@hootz
Script
Telegram DALLE Bot A personal telegram bot you can message to create images with OpenAI's DALLE ✨ Set up yours fork this val speak to telegram’s https://t.me/botfather to create a bot and obtain a bot token set the bot token as a val town secret called telegramDalleBotToken add a random string as a val town secret called telegramDalleBotWebhookSecret set up your webhook with telegram like this: // paste and run this in your workspace on here @vtdocs.telegramSetWebhook(@me.secrets.telegramDalleBotToken, { url: /* your fork's express endpoint (click the three dots on a val) */, allowed_updates: ["message"], secret_token: @me.secrets.telegramDalleBotWebhookSecret, }); message your bot some prompts! (if you get stuck, you can refer to the telegram echo bot guide from docs.val.town)
stevekrouse avatar
telegramBotHandler
@stevekrouse
Script
Telegram to DallE Bot Set up First you'll need to set yourself up to send and receive messages on Telegram. Follow all 5 steps here: https://www.val.town/v/stevekrouse.telegram Fork this @telegramBotHandler val below. Make sure you click Run to save it to your account. On your forked val, click the ⋮ menu > Endpoints > Copy express endpoint Message @ValTownBot /webhook Message @ValTownBot the express endpoint you copied You'll also need an openai key in your secrets for this particular DallE bot to work
stevekrouse avatar
telegramValTownBotWebhook
@stevekrouse
Express
The beating heart of the @ValTownBot on Telegram: https://www.val.town/v/stevekrouse.telegram
ghsaboias avatar
crypto_prices_info
@ghsaboias
Cron
An interactive, runnable TypeScript val by ghsaboias
stevekrouse avatar
telegramValTownBot
@stevekrouse
RPC
An interactive, runnable TypeScript val by stevekrouse
enyo avatar
telegramWebhookEchoMessage
@enyo
HTTP
An interactive, runnable TypeScript val by enyo
stevekrouse avatar
telegramSendPhoto
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
pomdtr avatar
telegram
@pomdtr
Script
Send yourself a Telegram message Inspired by console.email , this val lets you send yourself a Telegram message via the valtown_bot from any of your vals @me.telegram("hi to me on telegram!") Installation 1. Start a conversation with valtown_bot Click here: https://t.me/valtown_bot 2. Copy your Secret 3. Save in your secrets under telegramSecret 4. Fork this val & run it Save your own private version of a telegram function to your account by forking this val: https://www.val.town/v/pomdtr.telegram 5. Send a test message! await @me.telegram("hi to me on telegram!") PS: the bot code is available here
flafi87 avatar
weather_forecast_in_the_morning
@flafi87
Cron
An interactive, runnable TypeScript val by flafi87
maxm avatar
telegramWebhookExample
@maxm
HTTP
An interactive, runnable TypeScript val by maxm
dpetrouk avatar
notifyInTg
@dpetrouk
Script
Usage in bash: # Can be in .bashrc or .zsrhc: to-tg() { local input="" if [[ -p /dev/stdin ]]; then input="$(cat -)" else input="${@}" fi if [[ -z "${input}" ]]; then return 1 fi local chat_id="-1001826545120" # Set chat_id where your bot is local message="$input" curl -G https://api.val.town/v1/run/dpetrouk.notifyInTg --data-urlencode 'args=["'"$chat_id"'", "'"$message"'"]' } # You will get notification where command is succesfully finished <command in bash> && to-tg Success # Can be like that? <command in bash> | to-tg Success
smalldogenergy avatar
tgWebhook
@smalldogenergy
Script
An interactive, runnable TypeScript val by smalldogenergy