lospec daily bot

$ daily pixel art palette posts from Lospec to your Discord server

overview

A Discord bot that posts the daily pixel art palette from Lospec.com to any subscribed server channel every morning at 8 AM EST. It's designed for pixel art communities that want a daily creative prompt delivered automatically. No manual checking, no copy-pasting links. Not affiliated with Lospec.

Originally built for personal use and made public once it felt polished enough that others might find it useful.

tech stack

  • Python: Discord.py for bot framework, Aiohttp for async HTTP requests
  • BeautifulSoup4: HTML parsing of Lospec.com palette pages to extract daily palette slug and metadata
  • Per-server JSON persistence: subscription config stored in data/servers/{serverID}.json
  • Polling loop: 1-minute interval checks current time against 8 AM EST delivery target

links

showcase

Lospec Daily Bot Discord screenshot

how it works

A background loop polls once per minute and compares the current time (in EST) against the 8 AM delivery window. When the window opens, the bot fetches the Lospec dailies page and uses BeautifulSoup4 to locate the div.daily.tag and div.daily.palette elements, extracting the palette slug and display metadata from the page HTML. The palette image is constructed from the CDN URL pattern https://cdn.lospec.com/thumbnails/palette-list/{slug}-social.png.

Per-server configuration is stored in individual JSON files under data/servers/{serverID}.json. Each file records the subscribed channel ID, the bot's enabled/disabled state for that server, and delivery preferences. The bot exposes 6 slash commands for server admins to configure the channel, toggle posting, and check current settings.

takeaways

A small project, but it shipped and runs. The main value was building the full cycle: scraping, state management, slash commands, and deployment. Some key takeaways:

  • Web scraping with BeautifulSoup4, targeting stable selectors over positional parsing
  • Per-server bot configuration with JSON persistence
  • Discord slash command registration and interaction handling with Discord.py
  • Edge case handling for stateful scheduled delivery (restart safety, duplicate prevention)