TechBuzzPro

How to Build a Welcome Bot for Discord

· 6 min read · Discord

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can build a Discord welcome bot that automatically greets new members with a custom message, assigns roles, and even sends a direct message. The easiest way is to use a bot like MEE6 or Carl-bot, but if you want a fully custom bot, you'll need to write a small script using Discord.js (JavaScript) or discord.py (Python). This guide covers both the no-code route and the coding route, so you can pick what fits your skill level.

What You'll Need

  • A Discord account and a server where you have Manage Server permission.
  • For the no-code route: a web browser and the ability to invite a bot from its official website.
  • For the coding route: a computer with Node.js (for Discord.js) or Python (for discord.py) installed, and a code editor like VS Code.
  • A Discord application created at the Discord Developer Portal – you'll need the bot token.

Step-by-Step

Option 1: Using a Pre-Made Bot (No Coding)

  1. Choose a bot. Popular options include MEE6, Carl-bot, and Arcane. Go to the bot's official website (e.g., mee6.xyz or carl.gg).
  2. Invite the bot. Click the "Add to Discord" or "Invite" button, select your server, and authorize the bot. You'll need to grant the permissions it asks for (usually "Send Messages" and "Manage Roles").
  3. Open the bot's dashboard. After inviting, the site will usually redirect you to a dashboard. If not, go to the bot's site and log in with Discord.
  4. Find the "Welcome" module. In MEE6, it's under "Welcome Messages." In Carl-bot, it's under "Greeting." Look for a toggle or checkbox to enable it.
  5. Set the welcome message. Type a message like "Welcome {user} to our server!" – most bots support placeholders like {user} or {mention} that automatically fill in the new member's name or mention.
  6. Choose a channel. Select the text channel where the welcome message should appear (e.g., #general or #welcome).
  7. Optional: Assign a role. Many bots let you automatically give new members a role (like "Member"). Enable that option and select the role. Make sure the bot's role is above the role you're assigning in Server Settings > Roles.
  8. Save your settings. Click Save or Apply. Test by having a friend join the server (or use a second account) to see if it works.

Option 2: Coding Your Own Bot (Discord.js)

  1. Create a Discord application. Go to the Discord Developer Portal, click "New Application," give it a name, and create it.
  2. Get the bot token. In the left sidebar, click "Bot," then "Add Bot." Copy the token (keep it secret – anyone with it can control your bot).
  3. Invite the bot to your server. In the "OAuth2" > "URL Generator" section, select "bot" under Scopes, and under Bot Permissions pick "Send Messages" and "Manage Roles" (if you want role assignment). Copy the generated URL and open it in a browser, then select your server and authorize.
  4. Set up your project. Create a new folder on your computer, open a terminal in it, and run npm init -y to create a package.json file.
  5. Install Discord.js. Run npm install discord.js in the terminal.
  6. Write the bot code. Create a file named index.js and paste the following code:
    const { Client, GatewayIntentBits } = require('discord.js');
    const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers] });
    
    client.once('ready', () => {
      console.log('Bot is online!');
    });
    
    client.on('guildMemberAdd', async member => {
      const channel = member.guild.channels.cache.find(c => c.name === 'welcome');
      if (!channel) return;
      await channel.send(`Welcome to the server, ${member}!`);
    
      // Optional: assign a role
      const role = member.guild.roles.cache.find(r => r.name === 'Member');
      if (role) {
        await member.roles.add(role);
      }
    });
    
    client.login('YOUR_BOT_TOKEN');
  7. Replace the token. In the code, replace 'YOUR_BOT_TOKEN' with the token you copied earlier.
  8. Run the bot. In the terminal, run node index.js. If you see "Bot is online!" it's working.
  9. Test it. Have someone join your server (or use a second Discord account). The bot should send a welcome message in the channel named "welcome" (create one if it doesn't exist).

Common Mistakes

  • Using the wrong channel name. The code above looks for a channel named exactly "welcome". If your channel is named something else, the bot won't send a message. Adjust the code or create a channel with that name.
  • Bot role too low. If you're assigning roles, the bot's role must be positioned above the role you're giving. Go to Server Settings > Roles and drag the bot's role above the target role.
  • Missing intents. In Discord.js, you must enable the GuildMembers intent in the code (as shown above) and also in the Developer Portal under "Bot" > "Privileged Gateway Intents" – enable "Server Members Intent." Without it, the guildMemberAdd event won't fire.
  • Token exposed. Never share your bot token or commit it to a public repository. If leaked, regenerate it in the Developer Portal.
  • Using a bot that requires premium for welcome messages. Some bots like MEE6 limit welcome messages to premium users. Check the bot's feature list before relying on it.

Tips

  • Use placeholders for personalization. Most pre-made bots support {user}, {mention}, and {server} to make the message feel custom.
  • Add a rule channel link. In your welcome message, include a link to your rules channel so new members know where to read the rules.
  • Set up a verification step. Some bots (like Carl-bot) can require new members to click a button to get access – this helps prevent spam.
  • Keep the message short and friendly. A long wall of text is off-putting. A simple "Welcome! Check out #rules and #announcements" works well.
  • Test with a dummy account. Always test the welcome flow with a second account before going live.

Troubleshooting

If the bot doesn't send a welcome message:

  1. Check that the bot is online (look for its name in the member list). If not, run node index.js again and look for errors in the terminal.
  2. Verify that the channel name matches exactly. In the code, change c.name === 'welcome' to your actual channel name.
  3. Make sure the bot has permission to view and send messages in that channel. Right-click the channel > Permissions, and ensure the bot's role is allowed.
  4. For pre-made bots, double-check that the welcome module is enabled and saved. Sometimes the toggle is off by default.

If the bot isn't assigning roles:

  1. Confirm the role name matches exactly (case-sensitive).
  2. Ensure the bot's role is above the target role in Server Settings > Roles.
  3. Check that the bot has the "Manage Roles" permission.

If the bot crashes on startup:

  1. The most common cause is an invalid token. Copy the token again from the Developer Portal.
  2. Make sure you have installed Discord.js correctly: run npm install discord.js in the same folder as your index.js.

Frequently Asked Questions

Can I make a welcome bot without coding?

Yes, use a pre-made bot like MEE6 or Carl-bot. They offer a dashboard where you can set welcome messages and roles without writing any code.

Do I need to keep my computer on for the bot to work?

If you're running the bot from your own computer, yes. To keep it online 24/7, you need to host it on a cloud service like Heroku, Railway, or a VPS. Pre-made bots are hosted by their developers, so they stay online.

Can the bot send a direct message to new members?

Yes, both pre-made bots and custom code can send DMs. In Discord.js, use member.send('Welcome!') instead of channel.send. Note that some users may have DMs disabled for non-friends, so it might fail silently.

Is there a limit to how many welcome messages per day?

Discord has rate limits for bots, but for a normal server with a few new members per minute, you won't hit them. If you're in a huge server, the bot might get rate-limited – that's rare.

Can I customize the welcome message with images or embeds?

Yes. Pre-made bots like Carl-bot allow embeds. In your own code, you can use embed objects to send rich messages with color, images, and fields.

What if I want the bot to also remove a role when someone leaves?

That's not needed – when a member leaves, all their roles are automatically removed. But if you want to send a goodbye message, use the guildMemberRemove event in your code.