diff --git a/sukuinote/plugins/user_joins.py b/sukuinote/plugins/user_joins.py
index abda155..1cd8a5b 100644
--- a/sukuinote/plugins/user_joins.py
+++ b/sukuinote/plugins/user_joins.py
@@ -35,7 +35,11 @@ async def log_user_joins(client, update, users, chats):
raise ContinuePropagation
if not is_join and not config['config']['log_user_adds']:
raise ContinuePropagation
- text = f"{'User Join Event' if is_join else 'User Add Event'}\n- Chat: {html.escape(chats[chat_id].title)} [{sexy_chat_id}
]\n"
+ text = f"{'User Join Event' if is_join else 'User Add Event'}\n- Chat: "
+ atext = html.escape(chats[chat_id].title)
+ if getattr(chats[chat_id], 'username', None):
+ atext = f'atext'
+ text += f"{atext} [{sexy_chat_id}
]\n"
async with lock:
if (sexy_chat_id, message.id) not in handled:
if is_join: