Documentation Index
Fetch the complete documentation index at: https://bym.lonestill.uk/llms.txt
Use this file to discover all available pages before exploring further.
Данные сохраняются через localStorage. Каждый плагин работает в своём неймспейсе.
Методы
api.Storage.set(key, value) // сохранить; value — любой JSON-тип
api.Storage.get(key) // → value | null
get возвращает null если ключ не существует.
Поддерживаемые типы
api.Storage.set('obj', { x: 1, arr: [1, 2, 3] });
api.Storage.set('num', 3.14);
api.Storage.set('bool', false);
api.Storage.set('str', 'hello');
Настройки плагина
Настройки из meta.settings хранятся под ключом {pluginId}.{key}. Читать удобнее через getSetting:
// эквивалентно:
getSetting('myKey')
api.Storage.get('my-plugin-id.myKey')
Пример
BYM.register({ id: 'counter' }, (api) => ({
start() {
const count = (api.Storage.get('launches') ?? 0) + 1;
api.Storage.set('launches', count);
api.Logger.log(`Запуск №${count}`);
},
stop() {},
}));