mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-26 04:33:00 -05:00
Update this to ensure get_perms is not called if the API is disabled
This commit is contained in:
@@ -34,7 +34,6 @@ class GlobalCacheWrapper:
|
||||
self.session = session
|
||||
self.api_key = None
|
||||
self._handshake_token = ""
|
||||
self.can_write = False
|
||||
self._handshake_token = ""
|
||||
self.has_api_key = None
|
||||
self._token: Mapping[str, str] = {}
|
||||
@@ -164,7 +163,8 @@ class GlobalCacheWrapper:
|
||||
async def get_perms(self):
|
||||
global_api_user = copy(self.cog.global_api_user)
|
||||
await self._get_api_key()
|
||||
if self.api_key is None:
|
||||
is_enabled = await self.config.global_db_enabled()
|
||||
if (not is_enabled) or self.api_key is None:
|
||||
return global_api_user
|
||||
with contextlib.suppress(aiohttp.ContentTypeError, asyncio.TimeoutError):
|
||||
async with aiohttp.ClientSession(json_serialize=json.dumps) as session:
|
||||
|
||||
Reference in New Issue
Block a user