Skip Navigation

Bot Coding Guidelines

Lemmy Bot Best (Coding) Practices

Because of the increasing amount of Bots on lemmy and there is not (yet) a written Best (Coding) Practices post i want to make such Guideline.

The bot is required to follow the instances rules.

Guidelines

General Guidelines

For example, instead of calling all three endpoints (Posts, Comments, and Reports) every 30 seconds, you could call Posts every 30 seconds, Comments every 35 seconds, and Reports every 45 seconds. This would spread out the load on the server and prevent it from becoming overloaded.

For example, a spell-checking bot does not need to fetch reports. This will help to reduce the amount of data that your bot needs to store, which will improve performance.

This will improve performance and the strain to the server by reducing the number of times that your bot needs to fetch the data from the server.

This will free up space and improve performance.

This can be done by using error handling techniques and by storing important data in a way that can be easily recovered and use a Backoff system to increase the retry time until it reaches a limit to stop completly.

This will help to prevent the server from becoming overloaded.

This can cause conflicts and errors.

This includes using strong passwords and keeping their software up to date.

admin. They can help you to troubleshoot any problems.

This helps to prevent loops.

This helps to reduce load on the server.

This gives users control over whether or not they want to interact with your bot.

This helps users to identify your bot and understand its purpose.

For Improvment ideas leave a comment!

Comments

8

Comments

8