Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:43:49

And they said ˹to Moses˺, "O magician, invoke for us your Lord by what He has promised you. Indeed, we will be guided."  

And they said, to Moses, upon seeing the chastisement, ‘O sorcerer! — that is to say, ‘˹O˺ knowledgeable, perfect one’, since for them sorcery was an awesome ˹form of˺ knowledge — supplicate your Lord for us by the covenant that He has made with you, ˹to the effect˺ that He would relieve us from chastisement if we believe. Assuredly we will be guided’, that is to say, ˹we will become˺ believers.
القرآن:٤٣:٤٩

وَقَالُوا يَا أَيُّهَ السَّاحِرُ ادْعُ لَنَا رَبَّكَ بِمَا عَهِدَ عِنْدَكَ إِنَّنَا لَمُهْتَدُونَ  

{وقالوا} لموسى لما رأوا العذاب {يا أيها الساحر} أي العالم الكامل لأن السحر عندهم علم عظيم {ادع لنا ربك بما عهد عندك} عن كشف العذاب عنا إن آمنا {إننا لمهتدون} أي مؤمنون.