Update discum.py
turned the connectionTest function into a checkToken function (since connectionTest was basically just a duplicate of bot.info before)
-#REST api wrpas
+#REST api wraps
from .start.login import Login
from .start.superproperties import SuperProperties
from .start.other import Other
@@ -11,6 +11,8 @@ from .user.user import User
from .stickers.stickers import Stickers
from .science.science import Science
+from .RESTapiwrap import *
+
#gateway wraps
from .gateway.gateway import *
@@ -97,16 +99,15 @@ class Client:
##########################################################
'''
- test connection
+ test token
'''
- def connectionTest(self):
- url=self.discord+'users/@me?with_analytics_token=true'
- connection = self.s.get(url)
+ def checkToken(self, token):
+ editedS = Wrapper.editedReqSession(self.s, {"add":{"Authorization":token}})
+ connection = User(self.discord, editedS, self.log).info(with_analytics_token=True)
if connection.status_code == 200:
- Logger.log("Connected", None, self.log)
- self.userData = connection.json()
+ Logger.log("Valid token.", None, self.log)
else:
- Logger.log("Incorrect Token", None, self.log)
+ Logger.log("Invalid token.", None, self.log)
return connection
'''
