You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
217 B

import re
TOKEN_RE = re.compile(r'M\w{23}\.[\w-]{6}\..{27}')
def is_valid_token(token):
"""
Validates a Discord authentication token, returning true if valid.
"""
return bool(TOKEN_RE.match(token))