The Prophet ﷺ said: When any of you dozes in the mosque (on Friday), he should change his place. (Using translation from Abū Dāʾūd 1119)
سَمِعْتُ رَسُولَ اللهِ ﷺ يَقُولُ إِذَا نَعَسَ أَحَدُكُمْ فِي مَجْلِسِهِ يَوْمَ الْجُمُعَةِ فَلْيَتَحَوَّلْ مِنْهُ إِلَى غَيْرِهِ