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,16 +1,16 @@
|
||||
# ╔══════════════════════════════════════════════════════════════════╗
|
||||
# ║ ║
|
||||
# ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║
|
||||
# ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║
|
||||
# ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║
|
||||
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||
# ║ |H|e|x|a|H|o|s|t| ║
|
||||
# ║ +-+-+-+-+-+-+-+-+ ║
|
||||
# ║ ║
|
||||
# ║ © 2026 CodeX Devs — All Rights Reserved ║
|
||||
# ║ © 2026 HexaHost — All Rights Reserved ║
|
||||
# ║ ║
|
||||
# ║ discord ── https://discord.gg/codexdev ║
|
||||
# ║ youtube ── https://youtube.com/@CodeXDevs ║
|
||||
# ║ github ── https://github.com/RayExo ║
|
||||
# ║ discord ── https://discord.gg/hexahost ║
|
||||
# ║ github ── https://github.com/theoneandonlymace ║
|
||||
# ║ ║
|
||||
# ╚══════════════════════════════════════════════════════════════════╝
|
||||
from utils.db_paths import db_path
|
||||
|
||||
import discord
|
||||
from utils.emoji import TICK
|
||||
@@ -27,36 +27,36 @@ class AntiSpam(commands.Cog):
|
||||
self.recent_messages = {}
|
||||
|
||||
async def is_automod_enabled(self, guild_id):
|
||||
async with aiosqlite.connect("db/automod.db") as db:
|
||||
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||
cursor = await db.execute("SELECT enabled FROM automod WHERE guild_id = ?", (guild_id,))
|
||||
result = await cursor.fetchone()
|
||||
return result is not None and result[0] == 1
|
||||
|
||||
async def is_anti_spam_enabled(self, guild_id):
|
||||
async with aiosqlite.connect("db/automod.db") as db:
|
||||
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti spam'", (guild_id,))
|
||||
result = await cursor.fetchone()
|
||||
return result is not None
|
||||
|
||||
|
||||
async def get_ignored_channels(self, guild_id):
|
||||
async with aiosqlite.connect("db/automod.db") as db:
|
||||
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'channel'", (guild_id,))
|
||||
return [row[0] for row in await cursor.fetchall()]
|
||||
|
||||
async def get_ignored_roles(self, guild_id):
|
||||
async with aiosqlite.connect("db/automod.db") as db:
|
||||
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||
cursor = await db.execute("SELECT id FROM automod_ignored WHERE guild_id = ? AND type = 'role'", (guild_id,))
|
||||
return [row[0] for row in await cursor.fetchall()]
|
||||
|
||||
async def get_punishment(self, guild_id):
|
||||
async with aiosqlite.connect("db/automod.db") as db:
|
||||
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||
cursor = await db.execute("SELECT punishment FROM automod_punishments WHERE guild_id = ? AND event = 'Anti spam'", (guild_id,))
|
||||
result = await cursor.fetchone()
|
||||
return result[0] if result else None
|
||||
|
||||
async def log_action(self, guild, user, channel, action, reason):
|
||||
async with aiosqlite.connect("db/automod.db") as db:
|
||||
async with aiosqlite.connect(db_path("automod.db")) as db:
|
||||
cursor = await db.execute("SELECT log_channel FROM automod_logging WHERE guild_id = ?", (guild.id,))
|
||||
log_channel_id = await cursor.fetchone()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user