feat: black list for memes

This commit is contained in:
2025-03-28 14:00:14 +01:00
parent f3019d93b8
commit 2dc9604dc9
4 changed files with 56 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ from typing import Literal
import discord
from discord import app_commands
from database import add_pattern
from database import add_pattern, add_user_to_blacklist
from bot.config import update_patterns
from bot.utils import compile_stats, fetch_game_stats, perform_search
@@ -44,6 +44,21 @@ async def setup(bot):
f"Pattern added!\n**Regex:** `{regex}`\n**Response:** `{response}`"
)
@bot.tree.command(
name="add_to_blacklist",
description="Add a user to the blacklist.",
guild=discord.Object(id=GUILD_ID),
)
@app_commands.checks.has_permissions(administrator=True)
async def add_to_blacklist_cmd(
interaction: discord.Interaction, user: discord.User, reason: str
):
"""Slash command to add a user to the blacklist."""
add_user_to_blacklist(user.id, reason)
await interaction.response.send_message(
f"User **{user.name}** has been added to the blacklist.\n**Reason:** `{reason}`"
)
@bot.tree.command(
name="search",
description="Search for servers by hostname or IP.",