This is a simple welcome bot using python, created just to send automatic welcome messages :D
- 1 - Before starting the bot, make sure you have added YOUR BOT TOKEN on the
utils/config.json:-
{ "token": "YOUR_BOT_TOKEN" }
-
- 2 - The file
commands/welcome.pyhave another very important field to fill, is the"CHANNEL_ID". Replace bothCHANNEL_IDparameters with the ID of the channel that the bot will send and delete the welcome message.-
@bot.event async def on_member_join(member): channel_id = "CHANNEL_ID" # <-- here channel = bot.get_channel(channel_id)
-
@bot.event async def on_member_remove(member): channel_id = "CHANNEL_ID" # <-- here channel = bot.get_channel(channel_id)
-
- 3 - After that, customize the bot message in the same
commands/welcome.pyfile. The places to customize the messages are already being indicated within the file. If you want to move a line down in your message, just use the\nfunction- Code:
Console:
print("line 1 \n line 2")
line 1 line 2
- Code:
- 4 - Now your bot is ready, just activate then!
- You need to download the packages that are in the
requirements.txtfolder for the bot to work correctly. Use this on console:pip install py-cord==2.4.1 pip install NewFunctionsPYC==1.4.0
- This bot is using the py-cord library, not discord.py. If you have the discord.py library installed on your desktop, I recommend that you uninstall it and only use the py-cord library.
- Also check if you have python installed on your desktop.
If you want to place your bot on a host, I recommend that you place it on a host with 75Mb RAM or more. These are the hosts that I recommend you use to host the bot: