You have not mentioned how you injured your thumb.
Swelling can appear in injury
to soft tissues or to the underlying bone.
Its better if you get yourself seen by a doctor. Based on the mode and force of injury and findings on examination, your doctor will advise x ray to rule out fracture
to the finger bone.
If it hurts much, you may take pain killers like Acetaminophen
based on your weight.
Hope my answer helps you.
Wish you a speedy recovery.