Hoshimi
Guides

Filters and Lyrics

Apply audio filters and manage lyric subscriptions safely.

This page reflects command-level patterns used in the example bot. It helps you keep filter state and lyric subscriptions synchronized safely.

Type reference: Core API (TypeDoc)

Quick links:

Enable and Reset Filters

filters-basic.ts
import type {  } from 'hoshimi';

declare const : ;

await ..({
  : 1.25,
  : 1.25,
  : 1.25,
});

await ..({
  : 1.0,
  : 1.0,
  : 220,
  : 100,
});

await ..();

Lyrics Flow

lyrics-flow.ts
import type {  } from 'hoshimi';

declare const : ;

const  = await ..();

if ( && !('error' in )) {
  await ..('lyrics', );
  await ..('enabledLyrics', true);

  await ..();
}

Cleanup Pattern

lyrics-cleanup.ts
import type {  } from 'hoshimi';

declare const : ;

const  = await ..('lyricsId');
if () {
  const  = !!(await ..('enabledLyrics'));

  if () {
    await ..();
  }

  await ..('lyricsId');
  await ..('lyrics');
  await ..('enabledLyrics');
}

Common Pitfalls

  • player.filterManager.plugin is the Lavalink plugin filter manager.
  • player.filterManager.dspx is the DSPX plugin filter manager.
  • Always reset filters when switching presets aggressively.
  • For lyrics, treat provider errors as expected runtime cases and fallback gracefully.

On this page