Add ban2time and time2ban, add parse_time method
@@ -147,6 +147,11 @@ class DatabaseCog(commands.Cog):
async with self.bot.holder as cur:
await cur.execute('DELETE FROM timed_restrictions WHERE user_id=? AND type=?', (user_id, type))
+ async def get_time_restrictions_by_user_type(self, userid, type):
+ async with self.bot.holder as cur:
+ await cur.execute('SELECT * from timed_restrictions WHERE user_id=? AND type=?', (userid,type))
+ return await cur.fetchone()
+
async def get_time_restrictions_by_type(self, type):
async with self.bot.holder as cur:
await cur.execute('SELECT * from timed_restrictions WHERE type=?', (type,))
@@ -174,7 +179,6 @@ class DatabaseCog(commands.Cog):
async def add_watch(self, user_id):
async with self.bot.holder as cur:
await cur.execute('INSERT INTO watchlist VALUES(?)', (user_id,))
- return True
async def remove_watch(self, user_id):
async with self.bot.holder as cur:
