fix: bye getserve.rs

This commit is contained in:
2026-01-02 17:06:54 +01:00
parent 3f000b3cf7
commit 808c564d1c
3 changed files with 10 additions and 125 deletions

View File

@@ -5,7 +5,6 @@ import discord
from discord import app_commands
from bot.log import logger
from bot.utils import compile_stats, fetch_game_stats, perform_search
from database import (
get_meme_patterns,
add_aka_response,
@@ -84,39 +83,6 @@ async def setup(bot):
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.",
guild=discord.Object(id=GUILD_ID),
)
async def slash_search(interaction: discord.Interaction, query: str):
results = await perform_search(query)
await interaction.response.send_message(results)
@app_commands.checks.cooldown(1, 60, key=lambda i: (i.guild_id, i.user.id))
@bot.tree.command(
name="stats",
description="Get stats for a specific game or all games",
guild=discord.Object(id=GUILD_ID),
)
async def stats(
interaction: discord.Interaction, game: Literal["s1", "iw6", "t7", "all"]
):
if game == "all":
stats_message = await compile_stats()
else:
data = await fetch_game_stats(game)
if data:
stats_message = f"**Stats for {game.upper()}:**\n"
count_servers = data.get("countServers", "N/A")
count_players = data.get("countPlayers", "N/A")
stats_message += f"Total Servers: {count_servers}\n"
stats_message += f"Total Players: {count_players}\n"
else:
stats_message = "Failed to fetch game stats. Please try again later."
await interaction.response.send_message(stats_message, ephemeral=True)
@bot.tree.command(
name="aka",
description="Check if the input matches any predefined aka patterns.",