-
Notifications
You must be signed in to change notification settings - Fork 15
v2.beatmaps.discussions.votes_v3
ck edited this page Oct 6, 2024
·
2 revisions
async
Retrieves the votes given to beatmap set discussions.
const { auth, v2 } = require('osu-api-extended');
async function main() {
try {
await auth.login({
type: 'v2',
client_id: CLIENT_ID,
client_secret: CLIENT_SECRET,
cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
});
const result = await v2.beatmaps.discussions.votes({ discussion_id: 4533908 });
if (result.error != null) {
console.log(result.error);
return;
};
console.log(result);
} catch (error) {
console.log(error);
};
};
main();
Parameter | Type | Description |
---|---|---|
params.discussion_id? | number | |
params.sort? | 'id_desc' | 'id_asc' |
params.score? | '1' | '-1' |
params.user? | number | |
params.receiver? | number | |
params.limit? | number | |
params.cursor_string? | string | |
addons.legacy_only? | boolean | |
addons.apiVersion? | '20240130' | '99999999' |
addons.authKey? | string | |
addons.timeout_ms? | number | |
addons.ignoreSessionRefresh? | boolean |
export interface BeatmapsDiscussionsVotesResponse {
discussions: Discussion[]
users: User[]
votes: Vote[]
cursor?: Cursor
cursor_string?: string
}
export interface Discussion {
id: number
beatmapset_id: number
beatmap_id?: number
user_id: number
deleted_by_id: any
message_type: string
parent_id: any
timestamp?: number
resolved: boolean
can_be_resolved: boolean
can_grant_kudosu: boolean
created_at: string
updated_at: string
deleted_at: any
last_post_at: string
kudosu_denied: boolean
}
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?: string
username: string
groups: Group[]
}
export interface Group {
colour: string
has_listing: boolean
has_playmodes: boolean
id: number
identifier: string
is_probationary: boolean
name: string
short_name: string
playmodes: string[]
}
export interface Vote {
beatmapset_discussion_id: number
created_at: string
id: number
score: number
updated_at: string
user_id: number
}
export interface Cursor {
page: number
limit: number
}