modified: app.py
This commit is contained in:
20
app.py
20
app.py
@@ -758,12 +758,28 @@ async def hoi4remove(ctx, game_name: str, user: discord.Member):
|
||||
await ctx.send(f"❌ Error removing player: {str(e)}")
|
||||
|
||||
@bot.hybrid_command(name='hoi4setup', description='Add a player to an existing game')
|
||||
async def hoi4setup(ctx, game_name: str, user: discord.Member, team_name: str, t_level: int, country: Optional[str] = None):
|
||||
"""Add a player to an existing game"""
|
||||
async def hoi4setup(ctx, game_name: str, user: discord.Member, team_name: str, t_level: int, country: Optional[str] = None, force: Optional[str] = None):
|
||||
"""Add a player to an existing game. Use force='--force' to bypass MP ban."""
|
||||
if t_level not in [1, 2, 3]:
|
||||
await ctx.send("❌ T-Level must be 1, 2, or 3")
|
||||
return
|
||||
|
||||
# Check for MP ban role (unless --force is used)
|
||||
MP_BAN_ROLE_ID = 1432368177052127353
|
||||
if force != "--force":
|
||||
mp_ban_role = discord.utils.get(user.roles, id=MP_BAN_ROLE_ID)
|
||||
if mp_ban_role:
|
||||
embed = discord.Embed(
|
||||
title="🚫 Player Banned",
|
||||
description=f"{user.display_name} is currently banned from multiplayer games!",
|
||||
color=discord.Color.red()
|
||||
)
|
||||
embed.add_field(name="Banned Player", value=user.mention, inline=True)
|
||||
embed.add_field(name="Ban Role", value=mp_ban_role.name, inline=True)
|
||||
embed.set_footer(text="Contact an administrator if this is an error")
|
||||
await ctx.send(embed=embed)
|
||||
return
|
||||
|
||||
try:
|
||||
async with db_pool.acquire() as conn:
|
||||
async with conn.cursor(aiomysql.DictCursor) as cursor:
|
||||
|
||||
Reference in New Issue
Block a user