Skip to main content
Glama
wowjinxy
by wowjinxy

unban_member

Remove a user ban in Discord servers. Specify the user ID to lift the ban, with optional server ID and reason parameters for moderation management.

Instructions

Remove a ban for a user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYes
server_idNo
reasonNo

Implementation Reference

  • The core handler function for the 'unban_member' tool. It fetches the guild and user, then calls guild.unban(user, reason=reason) to remove the ban, and returns a confirmation message.
    async def unban_member(
        user_id: str | int,
        server_id: str | int | None = None,
        reason: str | None = None,
        ctx: Context = None,
    ) -> str:  # type: ignore[override]
        """Remove a ban for a user."""
    
        assert ctx is not None
        bot, config = await _acquire(ctx)
        guild_id = _resolve_guild_id(config, server_id)
        guild = await _ensure_guild(bot, guild_id)
    
        user = await _call_discord("fetch user", bot.fetch_user(_require_int(user_id, "user_id")))
        await _call_discord("unban member", guild.unban(user, reason=reason))
        return f"Unbanned {user.display_name} ({user.id}) from {guild.name}."

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wowjinxy/mcp-discord'

If you have feedback or need assistance with the MCP directory API, please join our Discord server