-
Notifications
You must be signed in to change notification settings - Fork 16
v2.chat.details_v3
ck edited this page Oct 6, 2024
·
1 revision
async
Get a specific channel. (Requires lazer authentication)
const { auth, v2 } = require('osu-api-extended');
async function main() {
try {
await auth.login({
type: 'lazer',
login,
password
cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
});
const result = await v2.chat.details({ channel_id: 24594482 });
if (result.error != null) {
console.log(result.error);
return;
};
console.log(result);
} catch (error) {
console.log(error);
};
};
main();
Parameter | Type | Description |
---|---|---|
params.channel_id | number | |
addons.legacy_only? | boolean | |
addons.apiVersion? | '20240130' | '99999999' |
addons.authKey? | string | |
addons.timeout_ms? | number | |
addons.ignoreSessionRefresh? | boolean |
export interface ChatDetailsResponse {
channel: Channel
users: User[]
}
export interface Channel {
channel_id: number
description: string
icon: string
message_length_limit: number
moderated: boolean
name: string
type: string
uuid: any
current_user_attributes: CurrentUserAttributes
last_message_id: number
last_read_id: number
users: number[]
}
export interface CurrentUserAttributes {
can_message: boolean
can_message_error: any
last_read_id: number
}
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
country: Country
cover: Cover
groups: any[]
}
export interface Country {
code: string
name: string
}
export interface Cover {
custom_url: string
url: string
id: any
}