Installation and setup ▶️​

1. Install the add-on by first uploading the files to the server or using the "Install from archive" function in the control panel.
2. Go to the permission group of the Registered group or any other group that you would like to grant permissions to use bots.
3. Find two permission groups: [021] AI Bots - ChatGPT and [021] AI Bots - GPT Dall-E. Adjust the permissions as needed for you (Below is a guide to permissions).
4. Create a new user that you plan to link to the bot.
5. Go to ACP –> Setup –> AI Bots –> Add bot.
6. Enter the name of the newly created user and set up prompts for the bot in the Tuning tab.
7. Set up groups for which the bot will be active and forums in which it will work in the Restrictions tab.

Additional user groups to which you are prompted to add a bot user are no different from those that are configured when editing a user – this is an option for convenience, as when adding a moderator or administrator.

Permissions 🚫​

[021] AI Bots – Contains general permissions for regular users.
Deactivate bots in own threads – Allows the user to disable bots in their thread. The option will be available when creating a thread and in thread view by clicking on [SIZE=5]...[/SIZE].

[021] AI Bots moderator permissions – Contains general moderator permissions.
Deactivate bots in any threads – Allows the user to disable bots in any thread. The option will be available when creating a thread and in thread view by clicking on [SIZE=5]...[/SIZE].

[021] AI Bots - ChatGPT Contains ChatGPT handler permissions. These permissions will be applied to all bots that use this handler.
[021] AI Bots - GPT Dall-E Contains GPT Dall-E handler permissions. These permissions will be applied to all bots that use this handler.
These two groups have the same permissions (but separate for each handler):
Use bots in conversations – Allow user to use bots in their private conversations with other users.
Use bots in threads – Allow user to use bots in threads they create or reply to.
Use bots in their profiles – Allow user to receive replies from bots in their profiles.
Max replies per thread – Limit the maximum number of replies to a user from bots in a single thread.
Max replies in threads per day – Limit the maximum number of replies in threads from bots per day for a user.
Max replies per conversation – Limit the maximum number of replies to a user from bots in a single conversation.
Max replies in conversations per day – Limit the maximum number of replies in conversations from bots per day for a user.
Max replies in bot profile per day – Limits the maximum number of replies for a user in a bot profile.

Tuning 🔧​

This tab is only active for the ChatGPT handler.

In this tab, you can set up prompts for bots in different contexts: conversations, threads, or nodes. The explanation for these fields contains all the necessary information to help compose prompts.

The context for the bot is also configured here – it's the number of messages that were before the message to which the bot responds, which will be available to the bot when generating a response. The smaller the context, the more the answer matches the prompt.

Smart ignore: an option that adds an extra prompt that allows messages to be ignored unless they are directed to a bot.

Restrictions ✋​

Here you can set global limits for the bot: groups for which it is active, nodes in which it is active, the maximum number of replies per thread / conversation, and so on.
These restrictions are designed to quickly set up a bot and work in conjunction with permissions. They are global. What does it mean? Let's take a look at an example:
The "Max replies per thread" option is set to 5.
The user accessing the bot has the "Max replies per thread" permission set to 10.
When a user tries to contact a bot in a thread that already has 5 posts from the bot, it will be ignored.
If you disable the global limit, then the user will be ignored only after the bot has answered him 10 times in person.
This is how all other permissions work.

Triggers 🔔​

There are two settings on this tab, Regexes and Ignore regexes, which may not be clear to non-development users.

The Regexes setting defines additional triggers for the bot's reaction, in addition to the standard mentions and quotes.
For example, in order for the bot to respond to messages containing the text "I want to get X images", you will need the following regular expression: /i\s+want\s+\d+\s+images/si.

You can ask ChatGPT to compose a regular expression with the prompt:
Please make regular expression for message that can contains "I want X images". It should ignore case and take into account that the given phrase may be part of other text.

The Ignore regexes field works the other way around - it allows you to configure ignoring a message that contains certain text.
For example, in order for a bot to ignore messages containing /nobots, you would need the following regular expression: /\/nobots/si

GPT Dall-E 🧩​

This handler returns a default message in case of successful image generation, otherwise it generates a recommendation where similar images can be found.
Successful generation message can be changed in this phrase: bs_aib_gpt_dalle_give_message
The names of attachments attached to the message are generated using the phrase bs_aib_image_filename_x. In this phrase, the following variables are available to you:
{prompt} – prompt based on which the image was generated.
{key} – generated image index.