🍌BananaUtils

Documentation for utils file containing useful functions for addon development.

BananaUtils is utils file that is required by all addons listed in this documentation and needs to be downloaded separately.

Installation

While BananaUtils is not an addon it should be installed like one, therefore to install it you need to put bananaUtils.js file downloaded from BuiltByBit resource page.

BrayanBot config migration

BananaUtils allows BrayanBot using to migrate their configs to the Olympus Bot format. Actions performed are:

  1. Making all keys start from small letter

  2. Removes BrayanBot slash command config and leaves only options object

  3. Makes option type names start from capital letter

  4. Renames file to start from small letter

Old file is saved under oldname.yml.old file.

To trigger the config migration, user is required to add # BRAYANBOT MIGRATE # to the end of the config file. All .old files will be ignored and won't be migrated.

Developer API

BananaUtils is meant to be used by addon developers or easier and faster addon development. Before using BananaUtils functions, it's best to register addon. This functions should be called at the top of addon code.

This, will register which creates a folder in addons_config called the same as registered addon name and allows for BrayanBot config migration.

Setup message

With setupMessage you are able to transform user-created message config to discord.js message config object. This functions includes support for content, embeds and components. It also supports variables both manual and these created using Utility functions.

All possible options for configPath are listed below in YAML format - since these options should be provided as options in you addon config file which should use YAML (as this is format that is used by Olympus Bot).

Message content

content contains the text that will be sent as a normal discord message content.

Message embeds

embeds is a list of objects containing configuration for embeds attached to the message. Limit of embeds in one message is 10.

fields is a list of config objects for embed fields. Limit of fields in one embed is 25.

Message components

components is a object containting from 1 to 5 actions row config objects.

Each action row can list of interactive elements - which can be both buttons and select menus. Each action row has a limit of 5 interactive elements.

Button component

Select Menu component

options is a list of config objects for select menu options

Setup command

This function is on BananaUtils roadmap and will be implemented in the future.

Other functions

Last updated