All Integrations
Discord Integration
Deploy your AI agent as a Discord bot. Slash commands and rich embeds for your community.
How it works with Discord
Three steps to add an AI assistant to your Discord server.
Add to Server
Bot invited to server
Permissions configured
Slash commands registered
What you get
A powerful AI assistant for your Discord community.
Slash Commands
The bot registers /ask and /search slash commands automatically when added to your server.
Rich Embeds
Responses come as beautifully formatted Discord embeds with source links.
@Mention Support
Users can also @mention the bot in any channel it has access to.
DM Support
Users can DM the bot directly for private queries away from public channels.
Quick setup
Build a custom Discord bot with the TypeScript SDK.
discord-bot.ts
// Discord.js bot with InfoLens
import { InfoLensClient } from '@infolens/sdk';
import { Client, GatewayIntentBits } from 'discord.js';
const il = new InfoLensClient({ apiKey: 'pk_live_...' });
const bot = new Client({
intents: [GatewayIntentBits.Guilds]
});
bot.on('interactionCreate', async (i) => {
if (!i.isChatInputCommand()) return;
const res = await il.agents.chat({
agentId: 'ag_7f3k9x2m',
apiKey: 'pk_live_...',
message: i.options.getString('question')
});
await i.reply(res.answer);
});