Verified Deck Shop Discord Bot

Clash Royale Discord extension I created back in 2018 under the Deck Shop brand. My first small successful project, retired but still running.

29,000
Discord servers in 2026

A member used /profile

Deck Shop APP

Star Points
Max Wins
Played Battles
Wins
Losses
Three Crown Wins
Friendly Battles
War Day Wins
Hosted/Played Tourneys
Clan Cards Collected
Cards Won
Total Donations

Current deck

Bot Cloudflare Worker

Discord works with bots through slash commands, where every command and interaction with it is a separate encrypted web request. In this case, I designed the bot to run as a Cloudflare Worker. It’s simple: one request for a command and a quick response after checking storage and the APIs to generate a Rich Embed for the message.

A cron job on the Worker also syncs game content, uploading each new card or icon as an emoji, which the bot then uses in Rich Embeds for that iconic Deck Shop look in responses.

Each response is customized to the user who sent it, with options to link their Clash Royale account, and for their server to change the language it responds in.

How a slash command is answeredFour steps. A member uses a slash command such as /clan. Discord requests a response from a Cloudflare Worker with an encrypted web request. The Worker processes it: it verifies the request came from Discord, reads storage and, if needed, Supercell’s official Clash Royale API, and builds the embed. It answers the request with an embed in the Deck Shop look, made for that request: for /clan, the clan’s name and badge, its members and its donations./clan1A member uses /clanrequest9f3a·c1e0·7b422Discord requests a responseWorkerVerifyReadEmbedStorageClash Royale API3The Worker processes4It answers the request How a slash command is answeredFour steps. A member uses a slash command such as /clan. Discord requests a response from a Cloudflare Worker with an encrypted web request. The Worker processes it: it verifies the request came from Discord, reads storage and, if needed, Supercell’s official Clash Royale API, and builds the embed. It answers the request with an embed in the Deck Shop look, made for that request: for /clan, the clan’s name and badge, its members and its donations./clan1A member uses /clanrequest9f3a·c1e0·7b422Discord requests a responseWorkerVerifyReadEmbedStorageClash Royale API3The Worker processes4It answers the request How a slash command is answeredFour steps. A member uses a slash command such as /clan. Discord requests a response from a Cloudflare Worker with an encrypted web request. The Worker processes it: it verifies the request came from Discord, reads storage and, if needed, Supercell’s official Clash Royale API, and builds the embed. It answers the request with an embed in the Deck Shop look, made for that request: for /clan, the clan’s name and badge, its members and its donations./clan1A member uses /clanrequest9f3a·c1e0·7b422Discord requests a responseWorkerVerifyReadEmbedStorageClash Royale API3The Worker processes4It answers the request
  • Cloudflare Workers
  • Discord bots
  • Supercell API
  • TypeScript
  • Internationalisation
  • Image rendering
  • App security

Clan logs Durable Objects

One special feature this Discord bot includes is clan logs. This is a paid add-on with a subscription for each log with one free log allowed per user or server. Once you enable clan logs for your clan, the bot will periodically wake up and alert you about changes within your clan. It runs on Cloudflare Durable Objects, which manage the state, and alarms, which wake up more or less often depending on clan activity. Each run checks for new members or changes within the clan and announces any in the channel via Discord webhooks.

How a clan log keeps up with its clanFour steps and a loop. A clan log is enabled with /clanlogs create: one log is free for each user or server, more are a paid add-on. An alarm wakes the clan’s own Durable Object, which keeps its state; its alarms come more or less often depending on how active the clan is. It checks the clan against its last snapshot: who joined, who left, who was promoted. It announces the changes in the server’s clan-log channel through a Discord webhook, as Deck Shop Logs, then sets its next alarm, and the loop starts again.1 freePaid/clanlogscreate1Clan logs are enabledDurable Object2Its Durable Object wakessnapshotnow3It checks the clan4It announces the changesand sets its next alarm How a clan log keeps up with its clanFour steps and a loop. A clan log is enabled with /clanlogs create: one log is free for each user or server, more are a paid add-on. An alarm wakes the clan’s own Durable Object, which keeps its state; its alarms come more or less often depending on how active the clan is. It checks the clan against its last snapshot: who joined, who left, who was promoted. It announces the changes in the server’s clan-log channel through a Discord webhook, as Deck Shop Logs, then sets its next alarm, and the loop starts again.1 freePaid/clanlogscreate1Clan logs are enabledDurable Object2Its Durable Object wakessnapshotnow3It checks the clan4It announces the changesand sets its next alarm How a clan log keeps up with its clanFour steps and a loop. A clan log is enabled with /clanlogs create: one log is free for each user or server, more are a paid add-on. An alarm wakes the clan’s own Durable Object, which keeps its state; its alarms come more or less often depending on how active the clan is. It checks the clan against its last snapshot: who joined, who left, who was promoted. It announces the changes in the server’s clan-log channel through a Discord webhook, as Deck Shop Logs, then sets its next alarm, and the loop starts again.1 freePaid/clanlogscreate1Clan logs are enabledDurable Object2Its Durable Object wakessnapshotnow3It checks the clan4It announces the changesand sets its next alarm
  • Durable Objects
  • Payments
  • Stripe

Storage KV + D1 + R2

Each part of the bot uses its own storage depending on its use case, but it’s very simple. Cloudflare KV for configuration, D1 SQLite for subscriptions and some clan-log states, and R2 for data snapshots from the Clash Royale API. Efficient and stable.

KV Read in milliseconds with tiny values per player or server.
  • Saved players
  • Server settings
  • Roles
  • Cards, decks and translations
D1 Important and queryable data that responds in milliseconds.

Subscriptions

Clan-log states

R2 Snapshots of data for clan logs to compare against.
Clash Royale API
  • Workers KV
  • D1
  • SQL
  • Object storage

History

In the past, this ran on a more traditional architecture: a small DigitalOcean droplet. In 2022 I rewrote the bot for the Cloudflare stack and it has been running here ever since. It costs a few dollars per month to host and is a retired project of mine that still runs and serves many people every single day.

  • Migrations
  • MongoDB
  • JavaScript & Node.js
  • DigitalOcean
  • Bash
  • Backups
  • Monitoring
  • Datadog
  • Reliability
  • Secrets management
  • Technical writing

Connected projects

Get in touch

I’m very open to challenging and ambitious work. My weekend projects are probably more complex than what you have in mind.

Message sent

Thanks. Replies go to the address you gave.

not sent

All three fields are needed, with a valid email address.

not sent

The bot check didn't pass. Please try again, or email hello@henrich.app.

not sent

Too many messages right now — please try again shortly.

not sent

Could not send right now. Please try again shortly.