This commit is contained in:
ITOH
2021-04-06 22:20:23 +02:00
parent 484e995140
commit 76e60deb2b
18 changed files with 79 additions and 3 deletions

View File

@@ -0,0 +1,7 @@
import { CreateMessage } from "../messages/create_message.ts";
import { FileContent } from "../misc/file_content.ts";
export interface DiscordenoCreateMessage extends CreateMessage {
/** The contents of the file being sent */
file?: FileContent | FileContent[];
}

View File

@@ -0,0 +1,7 @@
import { CreateGlobalApplicationCommand } from "../interactions/create_global_application_command.ts";
export interface DiscordenoCreateApplicationCommand
extends CreateGlobalApplicationCommand {
/** Id of the guild to create a guild only application command */
guildId: string;
}

View File

@@ -0,0 +1,6 @@
import { EditWebhookMessage } from "../webhooks/edit_webhook_message.ts";
export interface DiscordenoEditWebhookMessage extends EditWebhookMessage {
/** Id of the message you want to edit */
messageId: string;
}

View File

View File

@@ -0,0 +1,7 @@
import { Guild } from "../guilds/guild.ts";
export interface GuildUpdateChange {
key: keyof Guild;
oldValue?: unknown;
value?: unknown;
}

View File

@@ -0,0 +1,6 @@
import { InteractionResponse } from "../interactions/interaction_response.ts";
export interface DiscordenoInteractionResponse extends InteractionResponse {
/** Set to true if the response should be private */
private?: boolean;
}

View File

@@ -0,0 +1,12 @@
import { SnakeCaseProps } from "../util.ts";
import { Integration } from "./integration.ts";
export interface IntegrationCreateUpdate extends Integration {
/** Id of the guild */
guildId: string;
}
/** https://github.com/discord/discord-api-docs/blob/master/docs/topics/Gateway.md#integration-create-event-additional-fields */
export type DiscordIntegrationCreateUpdate = SnakeCaseProps<
IntegrationCreateUpdate
>;

View File

@@ -0,0 +1,13 @@
import { SnakeCaseProps } from "../util.ts";
export interface IntegrationDelete {
/** Integration id */
id: string;
/** Id of the guild */
guildId: string;
/** Id of the bot/OAuth2 application for this discord integration */
applicationId?: string;
}
/** https://github.com/discord/discord-api-docs/blob/master/docs/topics/Gateway.md#integration-delete-event-fields */
export type DiscordIntegrationDelete = SnakeCaseProps<IntegrationDelete>;

View File

@@ -1,3 +1,4 @@
import { GuildMember } from "../guilds/guild_member.ts";
import { User } from "../users/user.ts";
import { SnakeCaseProps } from "../util.ts";
import { InteractionApplicationCommandCallbackData } from "./application_command_callback_data.ts";

View File

@@ -5,11 +5,11 @@ export interface AllowedMentions {
/** An array of allowed mention types to parse from the content. */
parse: DiscordAllowedMentionsTypes[];
/** Array of role_ids to mention (Max size of 100) */
roles: string[];
roles?: string[];
/** Array of user_ids to mention (Max size of 100) */
users: string[];
users?: string[];
/** For replies, whether to mention the author of the message being replied to (default false) */
repliedUser: boolean;
repliedUser?: boolean;
}
/** https://discord.com/developers/docs/resources/channel#allowed-mentions-object */

View File

@@ -0,0 +1,17 @@
import { Embed } from "../embeds/embed.ts";
import { SnakeCaseProps } from "../util.ts";
import { AllowedMentions } from "./allowed_mentions.ts";
export interface EditMessage {
/** The new message contents (up to 2000 characters) */
content?: string | null;
/** Embedded `rich` content */
embed?: Embed | null;
/** Edit the flags of the message (only `SUPRESS_EMBEDS` can currently be set/unset) */
flags?: 4 | null;
/** Allowed mentions for the message */
allowedMentions?: AllowedMentions | null;
}
/** https://discord.com/developers/docs/resources/channel#edit-message-json-params */
export type DiscordEditMessage = SnakeCaseProps<EditMessage>;