Don't use bot token

This commit is contained in:
thecosmos
2020-04-14 16:31:23 +05:30
parent 95aa57a699
commit 386b0655c3

View File

@@ -33,18 +33,10 @@ class DiscordOAuth2HttpClient(abc.ABC):
self.client_id = app.config["DISCORD_CLIENT_ID"]
self.client_secret = app.config["DISCORD_CLIENT_SECRET"]
self.redirect_uri = app.config["DISCORD_REDIRECT_URI"]
self.bot_token = app.config.get("DISCORD_BOT_TOKEN", str())
if "http://" in self.redirect_uri:
os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "true"
app.discord = self
@property
def bot_authorization_header(self):
return {
"Authorization": f"Bot {self.bot_token}",
"Content-Type": "application/json",
}
@staticmethod
def _token_updater(token):
session["DISCORD_OAUTH2_TOKEN"] = token