@haelp/teto
Version:
A typescript-based controllable TETR.IO client.
53 lines (52 loc) • 1.63 kB
TypeScript
import { Social } from ".";
import { Social as SocialTypes } from "../../types";
import { Client } from "../client";
export declare class Relationship {
private social;
private client;
/** ID of the account on the other side of the relationsihp */
id: string;
/** ID of the relationship */
relationshipID: string;
/** Username of the account on the other side of the relationship */
username: string;
/** Avatar ID of the account on the other side of the relationship */
avatar: number;
/** The DMs that have been sent and received. You may need to call `loadDms` to populate this information */
dms: SocialTypes.DM[];
/** Promise that resolves when the dms have been loaded. This will not resovle if `Relationship.lazyLoadDms` is set to true. */
ready: Promise<void>;
/** Whether or not the dms have been loaded */
dmsLoaded: boolean;
static lazyLoadDms: boolean;
constructor(options: {
id: string;
relationshipID: string;
username: string;
avatar: number;
}, social: Social, client: Client);
/**
* Send a dm to the user.
* @example
* relationship.dm("Hello!");
*/
dm(content: string): Promise<void>;
/**
* Mark the dms as read
* @example
* relationship.markAsRead();
*/
markAsRead(): void;
/**
* Load the DMs for this relationship
* @example
* await relationship.loadDms();
*/
loadDms(): Promise<SocialTypes.DM[]>;
/**
* Invite the user to a game
* @example
* relationship.invite();
*/
invite(): void;
}