MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / get_application_id

Function get_application_id

scripts/setup_discord.py:70–82  ·  view source on GitHub ↗

Fetch the application ID from the token (same as bot user ID for bots).

(token: str)

Source from the content-addressed store, hash-verified

68
69
70def get_application_id(token: str) -> str | None:
71 """Fetch the application ID from the token (same as bot user ID for bots)."""
72 try:
73 response = requests.get(
74 f"{DISCORD_API_BASE}/users/@me",
75 headers={"Authorization": f"Bot {token}"},
76 timeout=10,
77 )
78 if response.status_code == 200:
79 return response.json().get("id")
80 except Exception:
81 pass
82 return None
83
84
85def build_invite_url(application_id: str, permissions: int = BOT_PERMISSIONS) -> str:

Callers 1

mainFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected