Public
Like
steamForumMentions
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
This is a cron that uses dreww's Steam Forum Scanner to regularly pull updates from Steam forums and surfaces them in Discord.
This script takes a Steam ID, Game Name, and array of discord webhook url destinations. It scans the main Steam community discussion page, and looks for new threads and threads with new comments, and then constructs a webhook with a configurable amount threads per hook, sending it to all configured destinations.
Right now, the script only looks at the main forum within the Steam community, so if you have multiple forums you'd probably need to extend it.
Before you can run the cron, you must add the following Environment Variables (via left sidebar of this val):
DISCORD_WEBHOOK_URL
: In your Discord server → Server Settings → Integrations → Webhooks → New Webhook → Copy Webhook URL
import scanSteamForums from "https://esm.town/v/dreww/steamforumscanner";
export default async function(interval: Interval) {
const dota2Threads = await scanSteamForums({
gameName: "Dota 2",
embedColor: 9043685, // optional decimal color to change the embed highlight
steamId: "570",
discordWebhook: Deno.env.get("DISCHOOK_URL_1"),
});
}
main.tsx
is a cron that runs automatically based on your configured schedule. You may also clickRun
to manually trigger the cron at any time, especially for testing purposes.
Cron