diff --git a/cogs/tags.py b/cogs/tags.py index 82d0917..4fdf5f0 100644 --- a/cogs/tags.py +++ b/cogs/tags.py @@ -27,6 +27,7 @@ class Tags: tags = await config.get_content('tags') # Same generator as the method for tags, other than the second check to get the tag that is provided result = [t for t in tags if t['tag'] == tag and t['server_id'] == ctx.message.server.id] + print("Tags: {}\nAmount of tags: {}".format(tags, len(tags))) if len(result) == 0: await self.bot.say('That tag does not exist!') return diff --git a/cogs/utils/config.py b/cogs/utils/config.py index 35258c0..6d69943 100644 --- a/cogs/utils/config.py +++ b/cogs/utils/config.py @@ -118,7 +118,9 @@ async def get_content(key: str): cursor = await r.table(key).run(conn) items = list(cursor.items)[0] except (IndexError, r.ReqlOpFailedError): + await conn.close() return {} # Rethink db stores an internal id per table, delete this and return the rest del items['id'] + conn.close() return items