mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 16:57:22 +00:00
types: add invite types (#703)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { SnakeCaseProps } from "../util.ts";
|
||||
|
||||
export interface GetInvite {
|
||||
/** Whether the invite should contain approximate member counts */
|
||||
with_counts?: boolean;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/invite#get-invite */
|
||||
export type DiscordGetInvite = SnakeCaseProps<GetInvite>;
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Channel } from "../channels/channel.ts";
|
||||
import { User } from "../users/user.ts";
|
||||
import { SnakeCaseProps } from "../util.ts";
|
||||
import { DiscordTargetUserTypes } from "./target_user_types.ts";
|
||||
|
||||
export interface Invite {
|
||||
/** The invite code (unique ID) */
|
||||
code: string;
|
||||
/** The guild this invite is for */
|
||||
guild?: Partial<Guild>;
|
||||
/** The channel this invite is for */
|
||||
channel: Partial<Channel>;
|
||||
/** The user who created the invite */
|
||||
inviter?: User;
|
||||
/** The target user for this invite */
|
||||
targetUser?: User;
|
||||
/** The type of user target for this invite */
|
||||
targetUserType?: DiscordTargetUserTypes;
|
||||
/** Approximate count of online members (only present when target_user is set) */
|
||||
approximatePresenceCount?: number;
|
||||
/** Approximate count of total members */
|
||||
approximateMemberCount?: number;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/invite#invite-object */
|
||||
export type DiscordInvite = SnakeCaseProps<Invite>;
|
||||
@@ -0,0 +1,17 @@
|
||||
import { SnakeCaseProps } from "../util.ts";
|
||||
|
||||
export interface InviteMetadata {
|
||||
/** Number of times this invite has been used */
|
||||
uses: number;
|
||||
/** Max number of times this invite can be used */
|
||||
maxUses: number;
|
||||
/** Duration (in seconds) after which the invite expires */
|
||||
maxAge: number;
|
||||
/** Whether this invite only grants temporary membership */
|
||||
temporary: boolean;
|
||||
/** When this invite was created */
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/invite#invite-metadata-object */
|
||||
export type DiscordInviteMetadata = SnakeCaseProps<InviteMetadata>;
|
||||
@@ -0,0 +1,4 @@
|
||||
/** https://discord.com/developers/docs/resources/invite#invite-object-target-user-types */
|
||||
export enum DiscordTargetUserTypes {
|
||||
STREAM = 1,
|
||||
}
|
||||
Reference in New Issue
Block a user