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.
stevekrouse avatar
sendDiscordDMExample
@stevekrouse
script
An interactive, runnable TypeScript val by stevekrouse
Danster21 avatar
registerDiscordSlashCommandWithOptions
@Danster21
script
An interactive, runnable TypeScript val by Danster21
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
interval
// 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
interval
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
interval
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
interval
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
interval
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
interval
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
Darok avatar
discordWebhookEx
@Darok
script
An interactive, runnable TypeScript val by Darok