# How to Automate Discord Welcome Messages using the API

- Tool: API Automations
- Difficulty: Beginner
- Fix time: 15-30 minutes
- Compatibility: Free — requires GUILD_MEMBERS privileged intent (self-enable below 100 guilds; verification required at 100+)
- Last updated: May 2026

## TL;DR

Automate Discord welcome messages by listening to the GUILD_MEMBER_ADD Gateway event (requires GUILD_MEMBERS privileged intent enabled in both Developer Portal and code) and posting an embed via POST /channels/{channel.id}/messages. This is Gateway-only — there is no REST polling fallback. The bot must maintain an active WebSocket connection. Rate limit: 5 messages per 5 seconds per channel.

## Best practices

- Enable GUILD_MEMBERS privileged intent in both the Developer Portal AND your code — mismatch causes silent failure or close code 4014.
- Always check that the welcome channel exists (not null) before trying to send — channel IDs can become invalid if the channel is deleted.
- Queue welcome messages and process at 1/second to handle join raids without hitting the 5 messages/5 seconds per-channel limit.
- Include the user's mention (not just username) in the content field outside the embed — this triggers the mobile push notification that welcome messages in embeds alone do not send.
- Cache the welcome channel object at startup using client.get_channel() rather than fetching it from the API on every join event.
- Use member.display_avatar.url (discord.py) or member.user.displayAvatarURL() (discord.js) for the thumbnail — these handle the default avatar fallback when the user has no custom avatar.
- Test by joining your test server from a second account — the actual join event is the only reliable way to verify the setup works end-to-end.

## Frequently asked questions

### Is the Discord API free to use for welcome bots?

Yes. The Discord REST API is completely free with no per-request pricing. The only costs are your server hosting. Privileged intents (including GUILD_MEMBERS) are also free — they require a portal toggle and verification at 100+ guilds, but there is no fee.

### What happens if I hit the rate limit posting welcome messages?

You get HTTP 429 with retry_after in seconds. Discord's official libraries (discord.py, discord.js) handle this automatically with exponential backoff. However, during large join raids you may see welcome messages delayed by several seconds as the queue builds up. Implement a 1/second processing queue to prevent this.

### Why does GUILD_MEMBER_ADD never fire on my bot?

Two causes: (1) the Server Members Intent is not enabled in the Developer Portal under your app's Bot tab, or (2) you enabled it in the portal but forgot intents.members = True in discord.py or GatewayIntentBits.GuildMembers in discord.js. Both portal and code must match. Also verify close code 4014 is not appearing in your bot's logs.

### Can I send a welcome DM instead of posting to a channel?

Yes. In discord.py, use await member.send(embed=embed) instead of channel.send(). In discord.js, use member.user.send({ embeds: [embed] }). Note that some users have DMs disabled from non-friend users — wrap the send in a try/catch and fall back to the channel message if the DM fails.

### Does my bot need to stay online 24/7 for welcome messages to work?

Yes. GUILD_MEMBER_ADD is a Gateway event delivered only to bots with an active WebSocket connection. If your bot is offline when a member joins, you will never receive that event — there is no replay or REST polling alternative. Host your bot on a always-on service (VPS, Railway, Fly.io, etc.).

### Can RapidDev help build a custom Discord welcome bot?

Yes. RapidDev has built 600+ apps including Discord bots with welcome flows, role assignment, and CRM integrations. Visit rapidevelopers.com for a free consultation.

### How do I include the server's total member count in the welcome message?

In discord.py, access member.guild.member_count — this is available directly from the GUILD_MEMBER_ADD event payload without an extra API call. In discord.js, use member.guild.memberCount. Note: this reflects the count after the new member joined, so the first member sees #1.

### Can I trigger a welcome message from a REST API call without a running bot?

Partially. You can POST a message to the welcome channel via REST with just a bot token — no Gateway connection needed. But you won't know when to call it unless you have another system notifying you of joins. The Gateway (WebSocket) is the only reliable way to receive real-time join events.

---

Source: https://www.rapidevelopers.com/api-automations/how-to-automate-discord-welcome-messages-using-the-api
© RapidDev — https://www.rapidevelopers.com/api-automations/how-to-automate-discord-welcome-messages-using-the-api
