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.
Объявление
BYM.register({
id: 'my-plugin',
settings: [
{ key, type, label, default, description? },
],
}, ...)
BYM автоматически отрисует UI для каждой настройки на странице плагина.
| Поле | Тип | Описание |
|---|
key | string | Ключ для чтения через getSetting(key) |
type | string | Тип контрола |
label | string | Подпись в UI |
default | any | Значение по умолчанию |
description | string | Подсказка под контролом (опционально) |
Типы контролов
boolean — тогл
{ key: 'showToast', type: 'boolean', label: 'Показывать уведомления', default: true }
number — слайдер
{
key: 'speed',
type: 'number',
label: 'Скорость',
default: 1.5,
min: 0.25,
max: 4,
step: 0.05,
description: 'Скорость воспроизведения при запуске',
}
string — текстовое поле
{ key: 'prefix', type: 'string', label: 'Префикс', default: '🎵' }
select — выпадающий список
{
key: 'format',
type: 'select',
label: 'Формат',
options: ['artist — title', 'title — artist', 'title'],
default: 'artist — title',
}
Чтение настроек
(api, getSetting) => ({
start() {
const speed = getSetting('speed') ?? 1.5;
const toast = getSetting('showToast') ?? true;
const format = getSetting('format') ?? 'artist — title';
},
})
getSetting(key) возвращает null если настройка не сохранена. Всегда используй ?? default.