A complete reference client for the public API, written in Python - source you can download and run yourself, or invite the maintainers' own hosted instance straight into your server.
Don't want to host it yourself? Invite our own always-on instance directly - free, no setup required.
If the hosted bot is unresponsive or shows offline, it may need a restart on our end - email support@israelgpt.site and we'll get it back up.
A Discord bot needs a persistent WebSocket connection to Discord's gateway. Serverless functions are short-lived and can't hold one. The bot is a separate, always-on process: a small VPS, any long-running container host, or your own machine. It talks to the public API like any other client, over HTTPS.
sig the API gave it, so the model knows those replies are really its own. It's held in memory: a restart forgets it, and /reset clears a channel's.messages only know user and assistant.media as follow-up messages.429, and says so when its key stops working.IsraelGPT-Discord-Bot/2.0, so the key's request log on the dashboard shows which calls came from it.| Command | What it does |
|---|---|
| /model | IsraelBot 1 or YahooBot 1 for this channel |
| /persona | Which of the 12 personas this channel uses |
| /effort | Low, medium or high: how creative the replies get |
| /uncensored | Uncensored mode on or off |
| /short | Ask for short replies (longMode: false), which suit Discord |
| /images | Post pictures, songs and podcast episodes, or not |
| /settings | Show this channel's settings |
| /reset | Put this channel's settings back, and forget its conversation |
Settings are per channel, shared by everyone in it. Slash commands sync globally by default, which can take up to an hour to show in Discord after the bot starts; set DISCORD_DEV_GUILD_ID in .env to sync to one test server at once.
bot and applications.commands scopes, and the Send Messages and Read Message History permissions.discord-bot/.env.example to .env and fill in DISCORD_BOT_TOKEN and ISRAELGPT_API_KEY.cd discord-bot
pip install -r requirements.txt
python bot.pyFrom bot.py. The transcript it passes in holds each earlier reply with its sig:
async def call_israelgpt(messages: list[dict], settings: dict) -> dict:
async with httpx.AsyncClient(timeout=60) as http:
response = await http.post(
f"{ISRAELGPT_API_BASE_URL}/chat",
headers={"Authorization": f"Bearer {ISRAELGPT_API_KEY}", "User-Agent": USER_AGENT},
json={
"messages": messages,
"personaId": settings["persona_id"],
"selectedModel": settings["model"],
"effort": settings["effort"],
"uncensoredMode": settings["uncensored"],
"longMode": not settings["short"],
},
)
if response.status_code == 429:
body = response.json()
raise RateLimited(body.get("error", {}).get("retry_after_seconds", 30))
if response.status_code in (401, 403, 503):
raise ApiUnavailable(f"{response.status_code} {response.text[:300]}")
response.raise_for_status()
return response.json()The bot is meant as a real starting point, not a toy. Fork discord-bot/, swap in whatever framework or language you like, and point it at the same API Reference. Nothing about the public API is bot-specific. If your fork runs for more than one server, give it its own key, and keep the key on the machine the bot runs on.