ft_discord_bot: The Discord Bot That Treats Documentation Like Infrastructure
A tiny Python bot turns Freqtrade support into a living FAQ, hot-reloads its command book from JSON, and routes users to curated answers instead of generic chat.
- This bot matters because it automates institutional memory, not tone, and that is a better fit for a high-friction trading community.
- Its real trick is the separation of content from code, which lets moderators update answers in a human-editable JSON file.
- Hot reload turns the command set into a live operational layer, so support can change without a redeploy or restart.
- The project wins by being narrow and reliable, even if that means carrying some obvious trade-offs in authorization and architecture.
The bot is a living FAQ, not a chatbot
The most interesting thing about ft_discord_bot is not that it answers questions. It is that it turns a Discord channel into a distribution layer for trusted community knowledge. The bot routes people toward curated commands, docs links, GitHub searches, and stock answers, which means the real product is consistency.
That matters in a trading community. People ask the same questions over and over, but the cost of a sloppy answer is higher than in a casual chat room. A simple first responder that is boring, predictable, and fast is often more useful than a clever one.
Why this matters in a trading community
Freqtrade sits in a domain where support questions are repetitive and consequences can be real. Users need help with backtesting, strategy settings, exchange quirks, and community norms. If the bot can point them to the right answer in one step, it saves moderator time and reduces the chance that someone improvises bad trading advice.
That is why the project’s anti-generic stance is notable. It does not try to simulate an expert. It tries to be a reliable index into the expert knowledge that already exists.
The brain is a JSON file, and that is the point
The bot’s knowledge lives in bot_commands.json, which acts like a flat-file FAQ. Commands map short triggers to long-form responses, and the content stays separate from the Python logic. That separation is the core design choice: the bot is a delivery mechanism, while the JSON file is the actual source of truth.
The implementation leans into practicality. It uses rapidjson with support for comments and trailing commas, which makes the file friendlier for humans to edit. In a community-maintained support layer, that matters more than strict purity.
Hot reload turns moderators into operators
The smartest move in the project is **reload_commands. An authorized user can pull in a fresh command file from a local path or a remote URL and make that new knowledge live without restarting the bot. In other words, moderators are not just answering questions. They are operating a shared knowledge system.
That changes the maintenance model. FAQ edits do not have to wait for a deploy. A docs update, a policy change, or a new warning can be published centrally and reflected in the channel immediately. For a support bot, that is a big deal.
| Support model | Update speed | Accuracy | Operational burden | Best at |
|---|---|---|---|---|
| Manual moderator replies | Fast in the moment, slow to scale | Depends on who answers | High | Nuanced one-off situations |
| Generic Discord bot commands | Usually easy to configure | Mixed | Medium | Simple automation |
| ft_discord_bot’s curated JSON layer | Fast after reload | High for approved answers | Low once maintained | Repeatable community support |
What hot reload actually buys
- No bot restart when the FAQ changes.
- No need to touch the Python code for every content edit.
- A remote command file can become the shared source of truth for moderators.
- The support layer stays current even when the codebase stays still.
How the command router actually behaves
The bot’s message flow is straightforward. It listens in on_message, checks for the double-asterisk prefix, and routes the message into command handlers. If the user is replying to someone else, the bot can preserve that context and direct the answer back to the original author.
That reply-aware behavior is subtle but important. It keeps the bot from becoming a blunt broadcast machine. The same command can serve a general chat thread or a direct follow-up without losing the target of the answer.
# Simplified flow
if message.content.startswith('**'):
if is_reply(message):
target = referenced_message.author
else:
target = message.author
command = parse_command(message.content)
response = process_command(command, target)
await message.reply(response)
Under the hood, helper functions generate different destinations. Some commands build docs URLs, some send people to GitHub, and some create search links. The bot is less a conversational agent than a router with a friendly face.
The clean idea, and the messy trade-off
There is one obvious compromise: the allowed manager list is hardcoded. That is simple and readable, but it is also a security and governance trade-off. It works because the bot is narrow and the team is small. If the project grows, that list becomes a candidate for role-based permissions or configuration-driven access control.
The other trade-off is architectural. The main message handler is carrying a lot of responsibility. It is fine in a small utility, but it will eventually feel like a god function if the command surface expands. The design is elegant because it is minimal, and that same minimalism is also the ceiling.
| Choice | Why it works | Where it hurts |
|---|---|---|
| Hardcoded managers | Easy to audit in a small repo | Brittle as the operator set changes |
| Monolithic message handler | Simple to understand | Harder to extend cleanly |
| JSON as knowledge base | Editable without code changes | Content governance still matters |
What this bot is really competing against
The real alternatives are not just other Discord bots. They are moderator labor, generic automation, and AI-first support tools. Manual replies are flexible but expensive. Generic bots are programmable but shallow. AI tools are broader, but they are not automatically better for a domain where correctness matters more than novelty.
This bot’s edge is that it stays narrow. It is built to return the approved answer quickly, in the right context, with almost no ceremony. That is enough for a community that values dependable support over conversational flair.
| Approach | Strength | Weakness |
|---|---|---|
| Manual moderation | Human judgment | Does not scale cleanly |
| AI-first support | Broad coverage | Can drift or hallucinate |
| ft_discord_bot | Curated reliability | Less flexible outside its domain |





