adverb
an adverb modifies a verb, adjective, or another adverb; in this case, 'pleasantly' modifies how something is done in a pleasant manner
-
The weather was pleasantly warm during the outdoor event.
-
I was pleasantly surprised by the delicious food at the new restaurant.
-
I felt pleasantly buzzed after a few drinks with friends.
-
Her words were like a pleasantly soothing melody to his ears.