Skip to content

v2.chat.messages_v3

ck edited this page Oct 6, 2024 · 1 revision

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.messages({ 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
params.limit? number
params.since? number
params.until? number
params.return_object? boolean
addons.legacy_only? boolean
addons.apiVersion? '20240130' '99999999'
addons.authKey? string
addons.timeout_ms? number
addons.ignoreSessionRefresh? boolean

Response

export interface ChatMessagesResponse {
  channel_id: number
  content: string
  is_action: boolean
  message_id: number
  sender_id: number
  timestamp: string
  type: string
  sender: Sender
}

export interface Sender {
  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
}

[v3.x.x] Documentation


[v2.x.x] Documentation

Clone this wiki locally