Starts with a slash command and a schedule

Birthdays

Nobody keeps a birthday list for 400 members. Each member saves their own date with /birthday-set, and at 08:00 the bot posts one message for everyone who has their birthday that day.

Illustration. The real interface may look different.

How it works

  1. /birthday-set saves a day and a month for the member who used it.

  2. A schedule checks every morning whose birthday it is.

  3. The bot posts a single message that mentions everyone celebrating that day.

How to make a birthday bot on Discord

Each member stores a day and a month, with no year, so nobody's age is on file. Every morning one flow checks the list and posts a single message.

Describe it to your AI assistant

I keep missing birthdays on our server. Build a birthday module: /birthday-set where members enter their day and month, /birthday-show to see what they saved and /birthday-unset to remove it. Do not store a year. Every morning at 8:00, post one happy birthday message in #general that mentions everyone whose birthday is today, and post nothing when there is none. Make the channel, the time and the greeting line settings.

Copy it and swap in your own channel and role names. Your assistant has a tested version of this example to start from.

Build it in the editor

Three flows: /birthday-set stores the date, a "Schedule" trigger starts the morning post, and a helper flow walks the saved birthdays. The tested module adds /birthday-show and /birthday-unset.

The 3 flows, step by stepStep names are the ones the editor shows.

Flow 1/birthday-set

Trigger: Slash command/birthday-set with the options day and month.

  1. IfRefuses dates that do not exist, such as 31 April.
  2. Build a shape valuePacks day and month into one value.
  3. Store a valueStores it for the member who ran the command.
  4. Reply to interactionConfirms privately.

Flow 2Morning post

Trigger: Scheduleread from the "Announcement schedule" setting, 09:00 every day in the tested version.

  1. Current date/timeTakes today's date.
  2. Set stored value if (atomic)Claims the day. If the schedule fires twice, the second run stops here.
  3. Call another flowRuns the collecting flow with today's day and month.
  4. Create messageBuilds one message from your greeting line and the mentions.
  5. Send messagePosts it in the announcement channel. When nobody has a birthday, the flow ends without posting.

Flow 3Collect birthdays

Trigger: Manual triggercalled by the morning post, with a day and a month.

  1. List storage entriesReads the saved birthdays.
  2. For each itemGoes through them one by one.
  3. Get a field of a shape valueTakes day and month out of each.
  4. List builder: add itemCollects the members whose date matches.
  5. Join listJoins their mentions with commas.
  6. Return from flowHands the result back.

Test it, change it

What it stores

  • BirthdayPer userDay and month per member. No year.
  • Last announced dayWhole serverOne date for the server, so a day is greeted once.

How to test it

  1. Open a flow in the editor and click "Test run". Choose the member under "Run as" and click "Run test". The run uses your real server data but sends, changes and deletes nothing, and shows what each step would have done.
  2. A new flow is a "Draft" and does not run in Discord. Switch it on and click "Save & activate".
  3. Save today's date with /birthday-set, then test the collecting flow with today's day and month. To see the real post, move the schedule a few minutes ahead.
  4. Each real run then shows up under "Executions", with the reason if it failed or was skipped.

What to change

Channel
The "Announcement channel" setting in the module's "Configuration" tab.
Time
The "Announcement schedule" setting. It follows your bot's timezone.
Wording
The "Greeting line" setting. The mentions are added after it.

Watch out for

  • The morning flow reads up to 100 saved birthdays per run. A server with more than that needs the walk split across several runs.
  • "Today" is today in your bot's timezone. Members on the other side of the world are greeted by your calendar.
  • Members who leave keep their saved date until someone removes it under "Stored data".

Questions about this build

Does the bot know how old a member is?

No. It stores a day and a month. There is no field for the year, so it cannot work out an age and nobody can look one up.

Can members remove their birthday again?

Yes, with /birthday-unset. It deletes the member's own entry, and the morning post leaves them out from then on.

Can the birthday person get a role for the day?

Not in this build. It takes two additions: "Add role to member" in the morning flow and a second scheduled flow that takes the role away again the next day.

Vill du ha in din server i betan?

V3 är ett stort system och det utvecklas fortfarande snabbt, så servrar släpps in en i taget i stället för alla på en gång. Varje ansökan läses av en person och du får svar inom några dagar.

Servrarna som redan är med i betan avgör en stor del av vad vi bygger härnäst. Det du bygger är ditt: flows och moduler finns kvar när betan tar slut.