mirror of
https://github.com/jcreek/discord.py-welcome-bot.git
synced 2026-07-13 10:53:43 +00:00
Added error catching when unable to message a member.
This commit is contained in:
@@ -27,8 +27,11 @@ here!
|
|||||||
@client.event
|
@client.event
|
||||||
async def on_member_join(member):
|
async def on_member_join(member):
|
||||||
print("Recognised that a member called " + member.name + " joined")
|
print("Recognised that a member called " + member.name + " joined")
|
||||||
|
try:
|
||||||
await client.send_message(member, newUserMessage)
|
await client.send_message(member, newUserMessage)
|
||||||
print("Sent message to " + member.name)
|
print("Sent message to " + member.name)
|
||||||
|
except:
|
||||||
|
print("Couldn't message " + member.name)
|
||||||
|
|
||||||
# give member the steam role here
|
# give member the steam role here
|
||||||
## to do this the bot must have 'Manage Roles' permission on server, and role to add must be lower than bot's top role
|
## to do this the bot must have 'Manage Roles' permission on server, and role to add must be lower than bot's top role
|
||||||
|
|||||||
Reference in New Issue
Block a user