This commit is contained in:
WhatDidYouExpect 2025-07-21 21:12:31 +02:00
parent 3c71e9f54e
commit 221f2370e4
5 changed files with 19 additions and 133 deletions

11
bot.py
View file

@ -481,6 +481,17 @@ async def about(ctx: commands.Context) -> None:
embed.add_field(name=f"OS", value=platform.platform())
await send_message(ctx, embed=embed)
@bot.hybrid_command(description="balls")
async def countUser(ctx, user: discord.User = None):
user = user or ctx.author
user_id = str(user.id)
with open(MEMORY_FILE, 'r') as f:
data = json.load(f)
count = sum(1 for entry in data if '_meta' in entry and entry['_meta'].get('user_id') == user_id)
await ctx.send(f"User {user.display_name}'s ID appears {count} times in the memory file.")
# Command: Show bot statistics (admin only)
@bot.hybrid_command(description="stats")