It is narrated from Sayyiduna Hasan bin Ali (may Allah be pleased with them both) that he said: I heard the Messenger of Allah (peace and blessings be upon him) saying: "Whoever makes frequent attendance at the mosque his constant habit will find a beneficial brother for the sake of Allah, or will gain from a mercy of Allah that is hoped for, or will obtain some new point of knowledge, or will find a word that guides him towards guidance, or will be granted a word that saves him from ruin and destruction, and he will abandon sins out of modesty or out of fear of Allah." Technically, this chain is da'if (weak) because the Successor is majhul (unknown); however, it has a shahid (supporting narration) from the hadith of Sayyiduna Abu Hurayrah (may Allah be pleased with him) as well.
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب المساجد / 1019
Hadith Gradingمحدثین:إسناده ضعيف
Hadith Takhrij«هذا إسناد ضعيف؛ لجهالة التابعي» «أخرجه المعجم الكبير للطبراني برقم: 2750، وأخرجه مجمع الزوائد ومنبع الفوائد برقم: 2029»