mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-07 18:02:31 -05:00
[Core] Implemented missing checks, extended DB
The DB has been extended and now covers the functionality of the old Settings class of the previous version
This commit is contained in:
@@ -152,7 +152,7 @@ class JsonGuildDB(JsonDB):
|
||||
await self.save()
|
||||
return value
|
||||
|
||||
def get_all(self, guild, default):
|
||||
def get_all(self, guild, default=None):
|
||||
"""Returns all entries of a guild"""
|
||||
if not isinstance(guild, discord.Guild):
|
||||
raise TypeError('Can only get guild data')
|
||||
@@ -182,7 +182,7 @@ class JsonGuildDB(JsonDB):
|
||||
"""Removes a global value"""
|
||||
if GLOBAL_KEY not in self._data:
|
||||
self._data[GLOBAL_KEY] = {}
|
||||
del self._data[key]
|
||||
del self._data[GLOBAL_KEY][key]
|
||||
await self.save()
|
||||
|
||||
async def pop_global(self, key, default=None):
|
||||
|
||||
Reference in New Issue
Block a user