The Messenger of Allah ﷺ said, "Whoever enters this mosque of ours to learn something good or to teach it is like a Mujahid in the path of Allah, and whoever enters it for any other purpose is like one gazing at something that does not belong to him."
حدثنا حسن حدثنا عبد الله بن لهيعة حدثنا أبو صخر عن المقبري
عن رسول الله ﷺ قال من دخل مسجدنا هذا ليتعلم خيرا أو ليعلمه كان كالمجاهد في سبيل الله ومن دخله لغير ذلك كان كالناظر إلى ما ليس له