mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
commit
f2f556ed12
@ -42,10 +42,10 @@ def on_user_joins(message):
|
|||||||
return
|
return
|
||||||
|
|
||||||
name = message.new_chat_participant.first_name
|
name = message.new_chat_participant.first_name
|
||||||
if hasattr(message.new_chat_participant, 'last_name'):
|
if hasattr(message.new_chat_participant, 'last_name') and message.new_chat_participant.last_name is not None:
|
||||||
name += u" {}".format(message.new_chat_participant.last_name)
|
name += u" {}".format(message.new_chat_participant.last_name)
|
||||||
|
|
||||||
if hasattr(message.new_chat_participant, 'username'):
|
if hasattr(message.new_chat_participant, 'username') and message.new_chat_participant.username is not None:
|
||||||
name += u" (@{})".format(message.new_chat_participant.username)
|
name += u" (@{})".format(message.new_chat_participant.username)
|
||||||
|
|
||||||
bot.reply_to(message, text_messages['welcome'].format(name=name))
|
bot.reply_to(message, text_messages['welcome'].format(name=name))
|
||||||
|
Loading…
Reference in New Issue
Block a user