Browse Source

Remove util.token module entirely

pull/78/head
andrei 7 years ago
parent
commit
76b34a039e
  1. 5
      disco/cli.py
  2. 10
      disco/util/token.py

5
disco/cli.py

@ -42,7 +42,6 @@ def disco_main(run=False):
from disco.client import Client, ClientConfig from disco.client import Client, ClientConfig
from disco.bot import Bot, BotConfig from disco.bot import Bot, BotConfig
from disco.util.token import is_valid_token
from disco.util.logging import setup_logging from disco.util.logging import setup_logging
if os.path.exists(args.config): if os.path.exists(args.config):
@ -60,10 +59,6 @@ def disco_main(run=False):
if hasattr(config, k) and v is not None: if hasattr(config, k) and v is not None:
setattr(config, k, v) setattr(config, k, v)
if not is_valid_token(config.token):
print('Invalid token passed')
return
if args.shard_auto: if args.shard_auto:
from disco.gateway.sharder import AutoSharder from disco.gateway.sharder import AutoSharder
AutoSharder(config).run() AutoSharder(config).run()

10
disco/util/token.py

@ -1,10 +0,0 @@
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))
Loading…
Cancel
Save