Skip to main content

Integrations

Ririko connects to outside services for AI, images, music, streams, anime data and free games. This page lists each service, what it needs, and what happens when it is missing. It is for the person who hosts the bot.

You set every key in the .env file. Never put a key in Discord or in the database. Restart the bot after you change .env. The .env.example file shows every variable.

1. Check Your Setup​

  • Run ririko doctor. It checks Node.js, the database settings, the Discord token and client ID, FFmpeg, the AI keys, the stream keys, Spotify and image generation. See development.md.
  • Open the dashboard Integrations page. It shows Configured or Not configured for each service. It never shows a key. See dashboard.md.

2. Summary​

FeatureServiceNeeded?Variables
The botDiscordYesDISCORD_TOKEN, DISCORD_CLIENT_ID
The dashboardDiscord OAuthFor the dashboardDISCORD_CLIENT_SECRET, DASHBOARD_URL, SECRET_VAULT_KEY
AI chatGemini, OpenAI or OllamaAt least one, for AISee section 3
ImagesGemini, Replicate or ComfyUIAt least one, for /imagineSee section 4
MusicLavalinkRecommendedSee section 5
Spotify linksSpotifyFor Spotify linksSee section 5
Twitch alertsTwitchFor Twitch alertsTWITCH_CLIENT_ID, TWITCH_CLIENT_SECRET
YouTube alertsYouTube Data APIOptionalYOUTUBE_API_KEY
TikTok alertsTikTok sessionOptionalTIKTOK_SESSION_ID, TIKTOK_API_KEY
Free gamesEpic Games Store, SteamNo keyNone
Anime searchJikan (MyAnimeList), AniListNo keyNone
Waifu imageswaifu.imNo keyNone
WallpapersWallHaven, Zerochan, KonachanNo keyNone
Reaction GIFsOtakuGIFsNo keyNone
LyricsLRCLIBNo keyNone

Full setup of Discord, the dashboard and Docker is in SETUP.md and deployment.md.

3. AI Chat Providers​

ProviderVariablesNotes
Google GeminiGEMINI_API_KEYThe default.
OpenAIOPENAI_API_KEY, optional OPENAI_BASE_URLSet OPENAI_BASE_URL for an OpenAI-compatible service.
OllamaOLLAMA_BASE_URLA server you run yourself.

DEFAULT_AI_PROVIDER picks the first provider. DEFAULT_AI_MODEL picks its model.

When a provider fails or runs out of quota, Ririko tries the next provider that you have set up. A provider that keeps failing is skipped for a short time. Each server can choose its own first provider and model. See ai.md.

4. Image Providers​

ProviderVariablesNotes
Google Gemini (Imagen)GEMINI_API_KEYThe default.
ReplicateREPLICATE_API_TOKENFlux models.
ComfyUI or Stable Diffusion WebUICOMFYUI_URL (or COMFYUI_BASE_URL, SD_WEBUI_URL)A server you run yourself.
MockNoneA placeholder picture for tests.

IMAGE_DEFAULT_PROVIDER picks the default. IMAGE_DAILY_QUOTA limits the images a member can make in 24 hours (default 30). Image requests wait in a queue, so a busy bot does not freeze.

5. Music​

PartVariablesNotes
LavalinkLAVALINK_ENABLED, LAVALINK_HOST, LAVALINK_PORT, LAVALINK_PASSWORD, LAVALINK_SECUREPlays YouTube, Spotify, SoundCloud and more. Without it, Ririko uses a built-in player with fewer sources.
YouTube cipherLAVALINK_YOUTUBE_CIPHER_URLOptional.
SpotifySPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET, SPOTIFY_DC, SPOTIFY_KEY, SPOTIFY_SP_DCNeeded to play Spotify links.

See music.md.

6. Stream Alerts​

PlatformVariablesNotes
TwitchTWITCH_CLIENT_ID, TWITCH_CLIENT_SECRETNeeded for Twitch alerts. Create an app at the Twitch developer console.
YouTubeYOUTUBE_API_KEYOptional. Without it, Ririko reads public pages.
TikTokTIKTOK_SESSION_ID, TIKTOK_API_KEYOptional. Without them, Ririko reads public pages.

STREAM_CHECK_INTERVAL_MS sets how often Ririko checks for live streams. The default is 60000 (1 minute). The dashboard reads the same Twitch keys, to look up Twitch names.

Ririko saves the preview picture of a stream and attaches it to the alert, so the alert still works after the stream ends. It sends each alert once for each stream, server and channel. See modules.md.

7. Services Without Keys​

These services need no setup. If one is down, the feature that uses it shows an error message.

  • Jikan and AniList answer anime, manga and character searches. Ririko asks Jikan first. If Jikan fails, it asks AniList and skips Jikan for 60 seconds.
  • waifu.im gives waifu images. The card game also uses it for card art.
  • WallHaven, Zerochan and Konachan give wallpapers.
  • OtakuGIFs gives reaction GIFs.
  • LRCLIB gives lyrics.
  • Epic Games Store and Steam give free games.

Every request has a time limit and a retry rule, so a slow service does not freeze the bot.