summaryrefslogtreecommitdiff
path: root/desktop/node_modules/@xhayper/discord-rpc/dist/structures/ClientUser.d.ts
blob: df31bcd7b3b026e8a29508af1efe0b1bcb02c974 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
import type { ActivityType, GatewayActivityButton } from "discord-api-types/v10";
import type { CertifiedDevice } from "./CertifiedDevice";
import { VoiceSettings } from "./VoiceSettings";
import { Lobby, type LobbyType } from "./Lobby";
import { Channel } from "./Channel";
import { Guild } from "./Guild";
import { User } from "./User";
export type SetActivity = {
    state?: string;
    details?: string;
    startTimestamp?: number | Date;
    endTimestamp?: number | Date;
    largeImageKey?: string;
    smallImageKey?: string;
    largeImageText?: string;
    smallImageText?: string;
    partyId?: string;
    partySize?: number;
    partyMax?: number;
    matchSecret?: string;
    joinSecret?: string;
    spectateSecret?: string;
    instance?: boolean;
    buttons?: Array<GatewayActivityButton>;
    type?: ActivityType.Playing | ActivityType.Watching | number;
};
export type SetActivityResponse = {
    state?: string;
    buttons?: string[];
    name: string;
    application_id: string;
    type: number;
    metadata: {
        button_urls?: string[];
    };
};
export declare class ClientUser extends User {
    fetchUser(userId: string): Promise<User>;
    /**
     * Used to get a guild the client is in.
     *
     * @param guildId - id of the guild to get
     * @param timeout - asynchronously get guild with time to wait before timing out
     * @returns partial guild
     */
    fetchGuild(guildId: string, timeout?: number): Promise<Guild>;
    /**
     * Used to get a list of guilds the client is in.
     * @returns the guilds the user is in
     */
    fetchGuilds(): Promise<Guild[]>;
    /**
     * Used to get a channel the client is in.
     * @param channelId - id of the channel to get
     * @returns partial channel
     */
    fetchChannel(channelId: string): Promise<Channel>;
    /**
     * Used to get a guild's channels the client is in.
     * @param guildId - id of the guild to get channels for
     * @returns guild channels the user is in
     */
    fetchChannels(guildId: string): Promise<Channel>;
    /**
     * Used to get the client's current voice channel. There are no arguments for this command. Returns the [Get Channel](https://discord.com/developers/docs/topics/rpc#getchannel) response, or `null` if none.
     * @returns the client's current voice channel, `null` if none
     */
    getSelectedVoiceChannel(): Promise<Channel | null>;
    /**
     * Used to join voice channels, group dms, or dms. Returns the [Get Channel](https://discord.com/developers/docs/topics/rpc#getchannel) response, `null` if none.
     * @param channelId - channel id to join
     * @param timeout - asynchronously join channel with time to wait before timing out
     * @param force - forces a user to join a voice channel
     * @returns the channel that the user joined, `null` if none
     */
    selectVoiceChannel(channelId: string, timeout?: number, force?: boolean): Promise<Channel>;
    /**
     * Used to leave voice channels, group dms, or dms
     * @param timeout - asynchronously join channel with time to wait before timing out
     * @param force - forces a user to join a voice channel
     */
    leaveVoiceChannel(timeout?: number, force?: boolean): Promise<void>;
    /**
     * Used to get current client's voice settings
     * @returns the voice setting
     */
    getVoiceSettings(): Promise<VoiceSettings>;
    /**
     * Used to change voice settings of users in voice channels
     * @param voiceSettings - the settings
     * @returns the settings that have been set
     */
    setVoiceSettings(voiceSettings: Partial<VoiceSettings>): Promise<VoiceSettings>;
    /**
     * Used by hardware manufacturers to send information about the current state of their certified devices that are connected to Discord.
     * @param devices - a list of devices for your manufacturer, in order of priority
     * @returns
     */
    setCeritfiedDevices(devices: CertifiedDevice[]): Promise<void>;
    /**
     * Used to accept an Ask to Join request.
     * @param userId - the id of the requesting user
     */
    sendJoinInvite(userId: string): Promise<void>;
    /**
     * Used to reject an Ask to Join request.
     * @param userId - the id of the requesting user
     */
    closeJoinRequest(userId: string): Promise<void>;
    /**
     * Used to join text channels, group dms, or dms. Returns the [Get Channel](https://discord.com/developers/docs/topics/rpc#getchannel) response, or `null` if none.
     * @param channelId - channel id to join
     * @param timeout - asynchronously join channel with time to wait before timing out
     * @returns the text channel that user joined
     */
    selectTextChannel(channelId: string, timeout?: number): Promise<Channel | null>;
    /**
     * Used to leave text channels, group dms, or dms.
     * @param timeout - asynchronously join channel with time to wait before timing out
     */
    leaveTextChannel(timeout?: number): Promise<void>;
    getRelationships(): Promise<Array<User>>;
    /**
     * Used to update a user's Rich Presence.
     *
     * @param activity - the rich presence to assign to the user
     * @param pid - the application's process id
     * @returns The activity that have been set
     */
    setActivity(activity: SetActivity, pid?: number): Promise<SetActivityResponse>;
    /**
     * Used to clear a user's Rich Presence.
     *
     * @param pid - the application's process id
     */
    clearActivity(pid?: number): Promise<void>;
    /**
     * Create a new lobby
     * @param type - lobby type
     * @param capacity - lobby size
     * @param locked - is lobby locked
     * @param metadata - additional data?
     * @returns lobby that user created
     */
    createLobby(type: LobbyType, capacity?: number, locked?: boolean, metadata?: any): Promise<Lobby>;
    /**
     * Used to join a new lobby.
     * @param lobbyId - the id of the lobby to join
     * @param secret - the secret of the lobby to join
     * @returns the lobby that the user joined
     */
    connectToLobby(lobbyId: string, secret: string): Promise<Lobby>;
    /**
     * Used to join a new lobby.
     * @param lobbyId - the id of the lobby to join
     * @param data - additional data to send to lobby
     * @returns the lobby that the user joined
     */
    sendToLobby(lobbyId: string, data: string): Promise<Lobby>;
    /**
     * Used to get a user's avatar
     * @param userId - id of the user to get the avatar of
     * @param format - image format
     * @param size - image size
     * @return base64 encoded image data
     */
    getImage(userId: string, format?: "png" | "webp" | "jpg", size?: 16 | 32 | 64 | 128 | 256 | 512 | 1024): Promise<string>;
}