You can create a Discord welcome bot using scheduled vals.

In this example, a scheduled val gets the most recent members for your server and sends a DM to new users from a bot that you’ll create. It avoids messaging users who joined the server before the bot was added.

When users reply to the bot, the message is forwarded as a DM.

1. Create a new Discord application

Visit https://discord.com/developers/applications:

create-an-app.png

2. Enable the server members intent

Since the bot will be requesting a list of guild members, you need to enable the SERVER MEMBERS INTENT on the Bot tab.

Screenshot 2023-06-20 at 23.35.01.png

3. Get your bot’s token

On the Bot tab, copy the TOKEN, and save it as a Val Town secret as discordBot.

Screenshot 2023-06-16 at 22.05.23.png

4. Create a link via the URL Generator

On the OAuth2 tab, under URL Generator, select the bot scope, and give it permission to Send Messages, and then copy the GENERATED URL at the bottom of the page.

Screenshot 2023-06-20 at 21.45.54.png

5. Click on the generated link

Choose the server you want to invite the bot to and press Continue.

Screenshot 2023-06-20 at 15.27.42.png

6. Get your Server ID