Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
hwangsihu committed Oct 21, 2024
1 parent 0736cb6 commit b4732f1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 35 deletions.
19 changes: 13 additions & 6 deletions src/commands/music/Lyrics.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { ActionRowBuilder, ButtonBuilder, type ButtonInteraction, ButtonStyle, ComponentType, type TextChannel, } from 'discord.js';
import {
ActionRowBuilder,
ButtonBuilder,
type ButtonInteraction,
ButtonStyle,
ComponentType,
type TextChannel,
} from 'discord.js';
import { getLyrics } from 'genius-lyrics-api';
import { Command, type Context, type Lavamusic } from '../../structures/index';

Expand All @@ -7,9 +14,9 @@ export default class Lyrics extends Command {
super(client, {
name: 'lyrics',
description: {
content: 'cmd.lyrics.description',
examples: ['lyrics'],
usage: 'lyrics',
content: 'cmd.lyrics.description',
examples: ['lyrics'],
usage: 'lyrics',
},
category: 'music',
aliases: ['ly'],
Expand All @@ -33,8 +40,8 @@ export default class Lyrics extends Command {
}

public async run(client: Lavamusic, ctx: Context): Promise<any> {
let player = client.manager.getPlayer(ctx.guild!.id);
if (!player) return await ctx.sendMessage(ctx.locale('event.message.no_music_playing'))
const player = client.manager.getPlayer(ctx.guild!.id);
if (!player) return await ctx.sendMessage(ctx.locale('event.message.no_music_playing'));
const embed = this.client.embed();

const track = player.queue.current!;
Expand Down
58 changes: 29 additions & 29 deletions src/utils/genius-lyrics-api.d.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
declare module 'genius-lyrics-api' {
interface SearchOptions {
apiKey: string;
title: string;
artist?: string;
optimizeQuery?: boolean;
}
interface SearchOptions {
apiKey: string;
title: string;
artist?: string;
optimizeQuery?: boolean;
}

interface Song {
id: number;
title: string;
url: string;
}
interface Song {
id: number;
title: string;
url: string;
}

interface LyricsOptions {
title: string;
artist: string;
}
interface LyricsOptions {
title: string;
artist: string;
}

interface AlbumArtOptions {
title: string;
artist: string;
}
interface AlbumArtOptions {
title: string;
artist: string;
}

interface SongByIdOptions {
id: number;
apiKey: string;
}
interface SongByIdOptions {
id: number;
apiKey: string;
}

export function search(options: SearchOptions): Promise<Song[]>;
export function getSong(options: { id: number; apiKey: string }): Promise<Song>;
export function getLyrics(options: LyricsOptions): Promise<string>;
export function getAlbumArt(options: AlbumArtOptions): Promise<string>;
export function getSongById(options: SongByIdOptions): Promise<Song>;
export function searchSong(options: SearchOptions): Promise<Song[]>;
export function search(options: SearchOptions): Promise<Song[]>;
export function getSong(options: { id: number; apiKey: string }): Promise<Song>;
export function getLyrics(options: LyricsOptions): Promise<string>;
export function getAlbumArt(options: AlbumArtOptions): Promise<string>;
export function getSongById(options: SongByIdOptions): Promise<Song>;
export function searchSong(options: SearchOptions): Promise<Song[]>;
}

0 comments on commit b4732f1

Please sign in to comment.