This val lets you send yourself Telegram messages via ValTownBot. This ValTownBot saves you from creating your own Telegram Bot.
However if I'm being honest, it's really simple and fun to make your own Telegram bot. (You just message BotFather.) I'd recommend most folks going that route so you have an unmediated connection to Telegram. However if you want to have the simplest possible setup to just send yourself messages, read on...
It takes less than a minute to set up!
Start a conversation with ValTownBot
Copy the secret it gives you
Save it in your Val Town Environment Variables under telegram
Send a message!
import { telegramText } from "https://esm.town/v/stevekrouse/telegram?v=14";
const statusResponse = await telegramText("Hello from Val.Town!!");
console.log(statusResponse);
import { telegramPhoto } from "https://esm.town/v/stevekrouse/telegram?v=14";
const statusResponse = await telegramPhoto({
photo: "https://placekitten.com/200/300",
});
console.log(statusResponse);
/roll
- Roll your secret in case you accidentally leak it./webhook
- Set a webhook to receive messages you send to @ValTownBotIf you send /webhook
to @ValTownBot, it will let you specify a webhook URL. It will then forward on any messages (that aren't recognized @ValTownBot commands) to that webhook. It's particularly useful for creating personal chatbots, like my telegram <-> DallE bot.
Telegram has a lovely API.
telegramValTownAPI
, which looks up your Chat Id via your secret and sends you a messageThis val was originally made by pomdtr.
Migrated from folder: External_APIs/telegram/telegram