mirror of
https://github.com/ragestudio/comty.js.git
synced 2025-06-09 02:24:18 +00:00
31 lines
622 B
TypeScript
31 lines
622 B
TypeScript
import request from "../../../request"
|
|
|
|
type RequestOptions = {
|
|
preferTranslation?: Boolean
|
|
}
|
|
|
|
type RequestParams = {
|
|
translate_lang?: String
|
|
}
|
|
|
|
export default async (
|
|
id: String,
|
|
options: RequestOptions = {
|
|
preferTranslation: false,
|
|
}
|
|
) => {
|
|
const requestParams: RequestParams = Object()
|
|
|
|
if (options.preferTranslation) {
|
|
requestParams.translate_lang = app.cores.settings.get("app:language")
|
|
}
|
|
|
|
const response = await request({
|
|
method: "GET",
|
|
url: `/music/lyrics/${id}`,
|
|
params: requestParams
|
|
})
|
|
|
|
// @ts-ignore
|
|
return response.data
|
|
} |