Discord SDK TypeScript Types

cgen-4f9b25057e71454e9f2638a42afea87e
This commit is contained in:
Builder.io 2025-11-05 07:33:41 +00:00
parent b06ea32e94
commit 99c866572f

View 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;
}
}