Update project configuration files, and API routes accordingly. Add SQLite runtime file ignores to .gitignore for better file management.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from utils.db_paths import db_path
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
@@ -29,7 +30,7 @@ class AntiEmojiCreate(commands.Cog):
|
||||
@commands.Cog.listener()
|
||||
async def on_guild_emojis_update(self, guild, before, after):
|
||||
if len(after) > len(before):
|
||||
async with aiosqlite.connect('db/anti.db') as db:
|
||||
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||
antinuke_status = await cursor.fetchone()
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from utils.db_paths import db_path
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
@@ -29,7 +30,7 @@ class AntiEmojiDelete(commands.Cog):
|
||||
@commands.Cog.listener()
|
||||
async def on_guild_emojis_update(self, guild, before, after):
|
||||
if len(after) < len(before):
|
||||
async with aiosqlite.connect('db/anti.db') as db:
|
||||
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||
antinuke_status = await cursor.fetchone()
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from utils.db_paths import db_path
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
@@ -29,7 +30,7 @@ class AntiEmojiUpdate(commands.Cog):
|
||||
@commands.Cog.listener()
|
||||
async def on_guild_emojis_update(self, guild, before, after):
|
||||
if len(after) == len(before): # An emoji was updated
|
||||
async with aiosqlite.connect('db/anti.db') as db:
|
||||
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||
antinuke_status = await cursor.fetchone()
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from utils.db_paths import db_path
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from datetime import timedelta, datetime
|
||||
@@ -34,7 +35,7 @@ class AntiSticker(commands.Cog):
|
||||
else:
|
||||
action = discord.AuditLogAction.sticker_update
|
||||
|
||||
async with aiosqlite.connect('db/anti.db') as db:
|
||||
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||
antinuke_status = await cursor.fetchone()
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from utils.db_paths import db_path
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import aiosqlite
|
||||
@@ -26,7 +27,7 @@ class AntiUnban(commands.Cog):
|
||||
|
||||
@commands.Cog.listener()
|
||||
async def on_member_unban(self, guild, user):
|
||||
async with aiosqlite.connect('db/anti.db') as db:
|
||||
async with aiosqlite.connect(db_path('anti.db')) as db:
|
||||
async with db.execute("SELECT status FROM antinuke WHERE guild_id = ?", (guild.id,)) as cursor:
|
||||
antinuke_status = await cursor.fetchone()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user