Skip to content

devhyper/nialink

Repository files navigation

Nialink

Nialink Logo

Nialink is a Discord bot that plugs Nia AI straight into your server. Search your chat history, look up Steam/Twitch/Spotify profiles, and pull answers from the web — all from Discord.

Add Nialink to your server

Invite Nialink

Commands

Type / in your server to see everything. Here's the rundown:

Chat History

  • /guild-index — Scrapes all your server's messages into a local database. You only need to run this once.
  • /guild-autosync on [minutes] — Keeps the database up to date after the initial index.
  • /ask [query] — Search chat history with AI. Uses Groq (Llama 3.3 70B) to reason about your server's messages. Works with time filters, names, recaps, etc.

Integrations

  • /steam [q] — Ask about Steam profiles. Just mention a username or paste a Steam ID and it'll auto-scrape if needed.
  • /twitch [q] — Ask about Twitch channels or check if someone's live. Auto-indexes anyone you mention.
  • /spotify [q] — Ask about Spotify profiles and playlists. Same deal, auto-indexes on the fly.

Other

  • /web [query] — Web search powered by Nia.

Self-Hosting

If you want to run your own version, here's how.

You'll need

  • Node.js v18+
  • Nia CLIcurl -fsSL https://app.trynia.ai/cli | sh then nia auth login
  • A Supabase project (free tier is fine)
  • A Groq API key (free tier is fine)

API Keys

Grab these depending on what integrations you want:

Key Where to get it Needed for
DISCORD_TOKEN / CLIENT_ID Discord Developer Portal Everything
SUPABASE_URL / SUPABASE_SERVICE_ROLE_KEY Supabase → Settings → API Everything
GROQ_API_KEY console.groq.com /ask
STEAM_API_KEY steamcommunity.com/dev/apikey /steam
TWITCH_CLIENT_ID / TWITCH_CLIENT_SECRET dev.twitch.tv/console /twitch
SPOTIFY_CLIENT_ID / SPOTIFY_CLIENT_SECRET developer.spotify.com/dashboard /spotify

Setup

git clone https://github.com/devhyper/nialink.git
cd nialink
npm install
cp .env.example .env
# fill in your keys

Database

Make a Supabase project and run this in the SQL Editor:

CREATE TABLE guild_configs (
  guild_id TEXT PRIMARY KEY,
  chat_source_id TEXT,
  sync_enabled BOOLEAN DEFAULT true,
  sync_interval BIGINT,
  steam_source_id TEXT,
  twitch_source_id TEXT,
  spotify_source_id TEXT
);

CREATE TABLE steam_members (
  guild_id TEXT NOT NULL,
  steam_id TEXT NOT NULL,
  player_name TEXT,
  PRIMARY KEY (guild_id, steam_id)
);

CREATE TABLE twitch_channels (
  guild_id TEXT NOT NULL,
  login TEXT NOT NULL,
  display_name TEXT,
  PRIMARY KEY (guild_id, login)
);

CREATE TABLE spotify_members (
  guild_id TEXT NOT NULL,
  spotify_id TEXT NOT NULL,
  display_name TEXT,
  PRIMARY KEY (guild_id, spotify_id)
);

Run

npm run deploy   # registers slash commands with Discord — run once or after changes
npm run start    # starts the bot

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors