Back to APIs list

Discord API examples & templates

Use these vals as a playground to view and fork Discord API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
Danster21 avatar
registerDiscordSlashCommandWithOptions
@Danster21
Script
// Example : https://discord.com/developers/docs/interactions/application-commands#slash-commands-example-slash-command
stevekrouse avatar
newStripeEvent
@stevekrouse
HTTP
Discord Notification for new Stripe Subscription This val receives webhooks from Stripe when we get a new subscriber to Val Town pro. The val: Verifies the signature to make sure it's really from Stripe Sends a message to our internal Discord channel Sends a thank you to the new subscriber If you send a GET request to this val, it responds with the thank you email – for ease of debugging. Setup If you want to set up something like this with your String account: Go to you Stripe Webhooks
janpaul123 avatar
twitterAlert
@janpaul123
Cron
Twitter 𝕏 keyword Alerts Custom notifications for when you, your company, or anything you care about is mentioned on Twitter. 1. Authentication You'll need a Twitter Bearer Token. Follow these instructions to get one. Unfortunately it costs $100 / month to have a Basic Twitter Developer account. If you subscribe to Val Town Pro, I can let you "borrow" my token. Just comment on this val and I'll hook you up. 2. Query Change the query variable for what you want to get notified for. You can use Twitter's search operators to customize your query, for some collection of keywords, filtering out others, and much more! 3. Notification Below I'm sending these mentions to a private channel in our company Discord, but you can customize that to whatever you want, @std/email, Slack, Telegram, whatever.
stevekrouse avatar
sendDiscordDMExample
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
mvaodhan avatar
showbot
@mvaodhan
Email
Forward Render Error Emails to Val Town's Engineering Discord Channel Render sends emails when deploys fail but I want those notifications to come in our team Discord channel, and tag our team. Render doesn't have webhooks for this, so I set up a Gmail filter and forward to this email handler val, which in turn forwards the content to our engineering Discord channel.
stevekrouse avatar
discordWelcomeBotCron
@stevekrouse
Cron
// Welcome new members to the Val Town Discord
stevekrouse avatar
discordWelcomedMembers
@stevekrouse
Script
// set at Thu May 02 2024 17:56:39 GMT+0000 (Coordinated Universal Time)
stevekrouse avatar
discordWelcomeBotStartedAt
@stevekrouse
Script
// set at Thu May 02 2024 17:56:39 GMT+0000 (Coordinated Universal Time)
arunc avatar
twitterAlert
@arunc
Cron
Twitter 𝕏 keyword Alerts Custom notifications for when you, your company, or anything you care about is mentioned on Twitter. 1. Authentication You'll need a Twitter Bearer Token. Follow these instructions to get one. Unfortunately it costs $100 / month to have a Basic Twitter Developer account. If you subscribe to Val Town Pro, I can let you "borrow" my token. Just comment on this val and I'll hook you up. 2. Query Change the query variable for what you want to get notified for. You can use Twitter's search operators to customize your query, for some collection of keywords, filtering out others, and much more! 3. Notification Below I'm sending these mentions to a private channel in our company Discord, but you can customize that to whatever you want, @std/email, Slack, Telegram, whatever.
Curt avatar
discord
@Curt
Script
An interactive, runnable TypeScript val by Curt
stevekrouse avatar
yellowBonobo
@stevekrouse
Script
// Then, we send a message via the DM
stevekrouse avatar
water_plant_bot
@stevekrouse
Cron
Water Plant Reminder Discord Bot Every Monday at 9am EDT send a message to our team's Discord channel to remind us to water our plant.
generatecoll avatar
oliveMarmot
@generatecoll
Cron
Daily Standup Bot Every weekday at 9am EDT send a message to our team's #engineering Discord channel to start a thread to remind us to do our standup. Slack version: @mikker/dailySlackRoundup
stevekrouse avatar
discordEventReceiver
@stevekrouse
HTTP
An interactive, runnable TypeScript val by stevekrouse
mimos avatar
twitterAlert
@mimos
Cron
Twitter 𝕏 keyword Alerts Custom notifications for when you, your company, or anything you care about is mentioned on Twitter. 1. Authentication You'll need a Twitter Bearer Token. Follow these instructions to get one. Unfortunately it costs $100 / month to have a Basic Twitter Developer account. If you subscribe to Val Town Pro, I can let you "borrow" my token. Just comment on this val and I'll hook you up. 2. Query Change the query variable for what you want to get notified for. You can use Twitter's search operators to customize your query, for some collection of keywords, filtering out others, and much more! 3. Notification Below I'm sending these mentions to a private channel in our company Discord, but you can customize that to whatever you want, @std/email, Slack, Telegram, whatever.
re757575 avatar
dailyStandupBot
@re757575
Cron
Daily Standup Bot Every weekday at 9am EDT send a message to our team's #engineering Discord channel to start a thread to remind us to do our standup. Slack version: @mikker/dailySlackRoundup