Intro
I was searching online for a program that could send a direct message, rather than just a "welcome message," to users when they join your server. However, I couldn't find anything, so I created one myself. If you found this post helpful, please leave a thanks!
Guide
1. Install discord.py (if you haven't already)
2. Create the bot script: This script will listen for new members joining the server and send them a direct message (DM) when they join.
Explanation of the Code
1. Intents: The bot needs intents.members to listen to member join events.
2. Events:
3. Token: Replace 'YOUR_BOT_TOKEN' with the bot token you obtained from the Discord Developer Portal.
Running the Bot in the Background
Windows: You can run the script using a scheduler like Task Scheduler.
Linux: Use nohup or screen to run the script in the background, e.g.
Important Notes
Discord Intents: Make sure to enable the Server Members Intent in the bot's settings on the Discord Developer Portal for this to work.
Bot Permissions: Your bot should have permission to send DMs to members in the server
PROGRAM CODE
DONT FORGET TO HIT THAT THANKS BUTTON IF THIS HELPED YOU IN ANY WAY! IT TAKES 1 SECOND TO CLICK IT!
I was searching online for a program that could send a direct message, rather than just a "welcome message," to users when they join your server. However, I couldn't find anything, so I created one myself. If you found this post helpful, please leave a thanks!
Guide
1. Install discord.py (if you haven't already)
2. Create the bot script: This script will listen for new members joining the server and send them a direct message (DM) when they join.
Explanation of the Code
1. Intents: The bot needs intents.members to listen to member join events.
2. Events:
- on_ready: Confirms when the bot is online.
- on_member_join: Sends a DM to the new member when they join.
3. Token: Replace 'YOUR_BOT_TOKEN' with the bot token you obtained from the Discord Developer Portal.
Running the Bot in the Background
Windows: You can run the script using a scheduler like Task Scheduler.
Linux: Use nohup or screen to run the script in the background, e.g.
Important Notes
Discord Intents: Make sure to enable the Server Members Intent in the bot's settings on the Discord Developer Portal for this to work.
Bot Permissions: Your bot should have permission to send DMs to members in the server
PROGRAM CODE
DONT FORGET TO HIT THAT THANKS BUTTON IF THIS HELPED YOU IN ANY WAY! IT TAKES 1 SECOND TO CLICK IT!





.event
