why I will (probably?) always agree to write a letter of recommendation for a student

Today, I heard from a student that I had a couple of semesters ago asking for a letter of recommendation for a master’s program. I only had the student in one class, his attendance was spotty, and I didn’t have a lot of sustained interactions with him, so I am questioning whether I would be the best letter writer for him. However, while I said as much to the student in my reply, I also told him that despite all of that, I would still be willing to write him a letter.