Discord SDK TypeScript Types
cgen-4f9b25057e71454e9f2638a42afea87e
This commit is contained in:
parent
b06ea32e94
commit
99c866572f
1 changed files with 46 additions and 0 deletions
46
client/lib/discord-types.ts
Normal file
46
client/lib/discord-types.ts
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
export interface DiscordUser {
|
||||
id: string;
|
||||
username: string;
|
||||
avatar?: string | null;
|
||||
email?: string | null;
|
||||
discriminator?: string;
|
||||
}
|
||||
|
||||
export interface DiscordSDKUser {
|
||||
id: string;
|
||||
username: string;
|
||||
discriminator?: string;
|
||||
avatar?: string | null;
|
||||
email?: string | null;
|
||||
verified?: boolean;
|
||||
bot?: boolean;
|
||||
system?: boolean;
|
||||
mfa_enabled?: boolean;
|
||||
public_flags?: number;
|
||||
}
|
||||
|
||||
export interface DiscordSDK {
|
||||
ready: () => Promise<void>;
|
||||
user: {
|
||||
getMe: () => Promise<DiscordSDKUser>;
|
||||
};
|
||||
commands?: {
|
||||
authorize: (options: {
|
||||
client_id: string;
|
||||
response_type: string;
|
||||
scope: string[];
|
||||
}) => Promise<{ code: string }>;
|
||||
getChannel: (id: string) => Promise<any>;
|
||||
};
|
||||
subscribe?: (
|
||||
event: string,
|
||||
callback: (data: any) => void,
|
||||
) => () => void;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
DiscordSDK?: DiscordSDK;
|
||||
discordSdkReady?: boolean;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue