Hard to say - my gut feeling is that it wasn't shooting the ball that did it. Maybe you fell down, caught yourself with the right hand or something like that.
I'd go see a doc and figure out what it is exactly that's wrong. Then you'll know how to deal with it.
If you don't wanna see a doc, you could try massaging the wrist every day, stretching the forearm muscles, foam rolling it. Take some NSAIDS as well. If that doesn't take care of it in a couple weeks, then rest is the usual prescription. Don't strain it in any way for a couple of weeks. No b-ball, no lifting, no pushups etc etc.
Anyway, that's what I'd do.