-
Notifications
You must be signed in to change notification settings - Fork 15
v2.assets.backgrounds_v3
ck edited this page Oct 6, 2024
·
2 revisions
async
Retrieves seasonal or beatmap backgrounds.
const { auth, v2 } = require('osu-api-extended');
async function main() {
try {
const result = await v2.assets.backgrounds({
type: 'seasonal'
});
// or
const result = v2.assets.backgrounds({
type: 'beatmapset',
set_id: 2130552,
});
if (result.error != null) {
console.log(result.error);
return;
};
console.log(result);
} catch (error) {
console.log(error);
};
};
main();
Parameter | Type | Description |
---|---|---|
params.type | 'seasonal' or 'beatmapset' | |
params.set_id | number | |
addons.legacy_only? | boolean | |
addons.apiVersion? | '20240130' | '99999999' |
addons.authKey? | string | |
addons.timeout_ms? | number | |
addons.ignoreSessionRefresh? | boolean |
export interface SeasonalBackgrounds {
ends_at: string
backgrounds: Background[]
}
export interface BeatmapsetBackground {
cover: string
"cover@2x": string
card: string
"card@2x": string
list: string
"list@2x": string
slimcover: string
"slimcover@2x": string
raw: string
fullsize: string
}
export interface Background {
url: string
user: User
}
export interface User {
avatar_url: string
country_code: string
default_group: string
id: number
is_active: boolean
is_bot: boolean
is_deleted: boolean
is_online: boolean
is_supporter: boolean
last_visit?: string
pm_friends_only: boolean
profile_colour: any
username: string
}