!joke
Fortgeschritten !dadjoke !witz
Zufälliger Witz aus einer Public Joke API. Kostenlos, keine Anmeldung.
- Steps
- 3
- Cooldown
- 30s/User
- Cooldown
- 5sglobal
- Zugriff
- Public
!dadjoke !witz
Zufälliger Witz aus einer Public Joke API. Kostenlos, keine Anmeldung.
API: https://icanhazdadjoke.com/ mit Accept: application/json
[Cmd] !jokeOhne Accept: application/json liefert die API HTML statt JSON.
| URL | https://icanhazdadjoke.com/ |
|---|---|
| Variable Name | joke |
| Parse result as JSON | aktiv |
| Headers | Accept: application/json · User-Agent: AzaCraft (https://azacraft.de) |
Response:
{ "id": "abc123", "joke": "Why don't skeletons fight each other? They don't have the guts.", "status": 200}Mit JSON-Parse-Toggle wird das zu:
%joke.id%%joke.joke%%joke.status%Then-Branch: Send Message + Break.
| Input | %fetchUrlStatusCode% |
|---|---|
| Operation | Greater Than |
| Value | 299 |
| Message | 😄 %joke.joke% |
|---|---|
| Send using bot account | aktiv |
| Feld | Wert |
|---|---|
| Name | !joke |
| Group | AzaCraft API |
| Commands | !joke!dadjoke!witz |
| Sources | Twitch Message |
| Global Cooldown | 5 |
| User Cooldown | 30 |
| Chat | Resultat |
|---|---|
!joke | ”😄 Why don’t skeletons fight each other? They don’t have the guts.” |
!dadjoke | gleich |
Es gibt mehrere deutschsprachige Joke-APIs. Beispiel witzapi.de:
| Feld | Wert |
|---|---|
| URL | https://witzapi.de/api/joke |
| Variable Name | witz |
| Parse result as JSON | ✅ aktiv |
Response (kann variieren): [{"id": 1, "text": "Was ist orange ..."}], also ein Array! Zugriff via %witz[0].text%.
Falls die API ein Array liefert, ist Pfad-Zugriff etwas tricky. Pragmatisch: bei diesen APIs raw-String nutzen und im Send Message als ganzes posten:
| Feld | Wert |
|---|---|
| Message | 😄 %witz% |
Output ist dann das ganze JSON, nicht ideal aber funktioniert für Quick’n’Dirty.
https://official-joke-api.appspot.com/random_joke liefert:
{ "id": 100, "type": "general", "setup": "Why was the math book sad?", "punchline": "Because it had too many problems."}Pattern hier: Setup + Punchline mit Delay zeigen.
[Cmd] !joke├── 1. Fetch URL: https://official-joke-api.appspot.com/random_joke → joke (JSON)├── 2. Send Message: "😄 %joke.setup%"├── 3. Delay 3000 ms└── 4. Send Message: "💀 %joke.punchline%"Gibt der Chat-Audience Zeit zum Mit-Denken. Klassisches Setup-Punchline-Format.
icanhazdadjoke und ähnliche APIs unterstützen meist Filter:
https://icanhazdadjoke.com/search?term=cat (Witze mit “cat”)User-Input nutzen:
URL: https://icanhazdadjoke.com/search?term=$urlencode(%input0%)$Response ist dann ein Array results[]. Bei vielen Treffern müsstest du einen random pickeln, wieder komplex ohne C#.
Accept: application/json fehlt: API liefert HTML statt JSON. Parse-Toggle erkennt das nicht und gibt komische Werte%joke.joke% plötzlich nichts liefert → API-Doku prüfen