Are you in the US?
If so you are probably OK. The bad news is that you probably will need to report that when you apply for an FAA medical, and they will probably require a substance abuse evaluation (at your expense).
I would assume that if this is the first and only time time that this has happened and you are young and not actually addicted to anything they will determine that it was a lapse in judgment not an addiction/abuse problem.
But you now have one strike...a DUI or other subsequent substance abuse problems could get your medical revoked. Be extra careful in the future.