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.
cephalization
smsjournalertextrelay
HTTP
* This val creates a webhook endpoint that receives text messages and sends SMS replies using the TextBelt API.
* It uses blob storage to keep track of message history and conversation state.
* The TextBelt API is used for sending SMS messages without requiring an API key.
* The conversation history is stored as an array of message objects containing sender, content, date, and phone number.
* OpenAI's GPT-4 is used to generate contextual responses based on the conversation history.
2
andreterron
twitter
Script
Login with ~~Twitter~~ 𝕏 Use this val to login with 𝕏 and save your token into a twitter_token val Usage Fork this val Change the 🔒 privacy to "Unlisted" Navigate to https://developer.twitter.com/en/portal/dashboard to create an OAuth app and save your client id and secret to your secrets page Navigate to https://{your_username}-twitter.web.val.run to authenticate with 𝕏 And then you'll have your tokens saved to a twitter_token val! Other ~~Twitter~~ 𝕏 helper vals Refresh your tokens: https://www.val.town/v/andreterron/refreshTwitterToken Fetch user by id: https://www.val.town/v/andreterron/fetchTwitterUser Search posts: https://www.val.town/v/andreterron/searchTweets Write an X post: https://www.val.town/v/andreterron/postTweet
3