Skip to content
ck edited this page Oct 6, 2024 · 1 revision

async Retrieves the list of channels the current User is in. (Requires lazer authentication)

Usage example

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.updates({
      after_id: 3641891943,
      includes: ['presence', 'silences']
    });
    if (result.error != null) {
      console.log(result.error);
      return;
    };

    console.log(result);
  } catch (error) {
    console.log(error);
  };
};

main();
Parameter Type Description
params.after_id? number
params.includes? ('presence' 'silences'
params.history_since? number
addons.legacy_only? boolean
addons.apiVersion? '20240130' '99999999'
addons.authKey? string
addons.timeout_ms? number
addons.ignoreSessionRefresh? boolean

Response

export interface ChatUpdatesResponse {
  presence: Presence[]
  silences: Silence[]
}

export interface Silence {
  id: number
  user_id: number
}


export interface Presence {
  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?: string
  last_read_id?: number
}

[v3.x.x] Documentation


[v2.x.x] Documentation

Clone this wiki locally