Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -50,19 +50,18 @@ async def on_ready():
|
|
50 |
print("------")
|
51 |
|
52 |
|
53 |
-
@bot.event
|
54 |
async def on_member_join(member):
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
-
@bot.event
|
62 |
-
async def on_message(message):
|
63 |
-
if message.channel.id == 1210559547874222083 and not message.author.bot:
|
64 |
-
await message.channel.send(f"Hello {message.author.mention}!")
|
65 |
-
await bot.process_commands(message)
|
66 |
|
67 |
|
68 |
# running in thread
|
|
|
50 |
print("------")
|
51 |
|
52 |
|
|
|
53 |
async def on_member_join(member):
|
54 |
+
guild = member.guild
|
55 |
+
# Check if the channel with the specific ID exists in the guild
|
56 |
+
welcome_channel = guild.get_channel(1210559547874222083)
|
57 |
+
if welcome_channel:
|
58 |
+
if welcome_channel.permissions_for(guild.me).send_messages:
|
59 |
+
await welcome_channel.send(f"Welcome {member.mention} to our server!")
|
60 |
+
else:
|
61 |
+
print(f"Bot doesn't have permission to send messages in {welcome_channel.name}.")
|
62 |
+
else:
|
63 |
+
print("Welcome channel not found.")
|
64 |
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
|
67 |
# running in thread
|