Flow reference: Plugins

AI Chat

Ask Bottly's AI and get a reply in your bot's own voice, with optional memory per member or channel. Uses the bot owner's daily AI requests. AI Chat plugin.

Ask Bottly's AI and get a reply in your bot's own voice, with optional memory per member or channel. Uses the bot owner's daily AI requests. AI Chat plugin.

When and how to use it

Install the AI Chat plugin on the bot, then put this block after a trigger: a slash command such as /ask, or a Message Received trigger for a chat channel.
Fill prompt with the text to answer, for example {question} or {message.content}.
Connect out to a Reply or Send Message with {ai.reply}, and failed to a short error message with {ai.error}.

Configuration fields

Message to answer — prompt


What the member said. Usually {question} from a slash option or {message.content} from a message.

Default: {message.content}.


AI provider — provider


Empty (or bottly) uses Bottly's AI and the bot owner's daily AI requests. To use your own account write the provider: openai, gemini, anthropic, groq, openrouter, mistral, deepseek or xai, usually as {env.AI_PROVIDER} from the bot's settings.


API key — apiKey


Your key for that provider. Keep it in the bot's settings and write {env.AI_API_KEY} here: settings are stored encrypted and only the running bot reads them.


Model — model


Optional, e.g. gpt-4o-mini or gemini-2.5-flash, usually {env.AI_MODEL}. Empty uses the provider's default.


Personality and rules — personality


Who the bot is and how it answers: tone, language, topics it stays on. Members cannot change it.


Memory — memory


off answers every message on its own, user remembers the last few messages of each member, channel keeps one shared conversation per channel. Memory is kept in the bot's Bottly storage (table ai_memory).

Default: user.


Longest answer (characters) — maxLength


Up to 1900, so the answer fits one Discord message.

Default: 1500.


Store as — storeAs


Prefix of the result: {ai.reply} is the answer, {ai.error} explains a failure.

Default: ai.

Outputs and next steps

out: The answer is ready in {ai.reply}.
failed: No answer, for example when the owner's daily AI requests are used up; {ai.error} says why.

Long answers take a few seconds: in slash commands put Defer Reply before this block.

Test and troubleshoot

Every answer uses one of the bot owner's daily AI requests (Free 10, Pro 40, Ultimate 150). Answers never ping @everyone or @here. The Live Preview shows a placeholder instead of a real answer. [Testing](/docs/flow-testing) · [Variables](/docs/flow-variables).