# Wat is de canonieke aanpak voor een plugin om bots te maken?

**URL:** https://meta.discourse.org/t/what-is-the-canonical-approach-for-a-plugin-to-create-bots/347647
**Category:** Development
**Created:** [17 januari 2025 om 10:23 UTC](https://meta.discourse.org/t/what-is-the-canonical-approach-for-a-plugin-to-create-bots/347647 "2025-01-17T10:23:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![av203](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/av203/32/243894_2.png) [@av203](https://meta.discourse.org/u/av203)
#### Post date: [17 januari 2025 om 10:23 UTC](https://meta.discourse.org/t/what-is-the-canonical-approach-for-a-plugin-to-create-bots/347647/1 "2025-01-17T10:23:42Z")

</div>

Hey,  
I’m looking into a implementing a plugin that creates and manages bots as part of its’ functionality.

My requirements for these bots are:

1. There is a dynamic number of them, not a predefined set amount
2. They need to be able to author topics (programmatically)

From what I found so far:

- [Discourse has some logic in place that checks if a user has negative id, it treats it as a bot, or skips some non-bot behavior](https://github.com/search?q=repo%3Adiscourse%2Fdiscourse%20%22id%20%3C%200%22&type=code)
- [This very explicit check if a user is a human, checking for a positive user id](https://github.com/discourse/discourse/blob/560c1875a54da2e3c539ce9bae4ddf72252b8993/app/models/user.rb#L476)
- [This is a snippet from the official `discourse-ai` plugin on handling the creation of a bot](https://github.com/discourse/discourse-ai/blob/4784e7fe43ff25c44df986a56f70c0c1c017a51a/app/models/llm_model.rb#L87)

My question is: Is manually creating a `User` model with negative `id` the “proper” way of creating bots?

What I’m worried about is potentially creating future problems for myself by creating a User like that.
