mirror of
https://github.com/alterware/aw-bot.git
synced 2025-10-26 22:16:58 +00:00
feat: black list for memes
This commit is contained in:
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user