E.7. Plugin Conventions

The first convention about plugins has been mentioned already: all plugins should define a help describing themselves. This help can be as detailed as necessary.

Another convention regards the use of triggers, aliases, macros, timers and hooks. All of them should have names (and they should always be referenced by names, because the plugin writer cannot know which number will be assigned to them), and the names should consist of the name of the plugin, a colon, and then some descriptive name for the trigger (or alias, etc). This is to avoid name clashes with other plugins.

Another aspect regarding triggers, aliases, macros, timers and hooks is that they should only be created in the top-level scope, which means they are created when the plugin is loaded. They must not be created in a function that is called later, because this way they would not be recognized as belonging to the plugin, and this would create a mess for the user. So create them outside any functions.