types(channels): add ModifyChannel and CreateMessage (#697)

This commit is contained in:
ayntee
2021-03-28 16:02:31 +04:00
committed by GitHub
parent b86638759a
commit 4eb59f8511
2 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { Embed } from "../embeds/embed.ts";
import { AllowedMentions } from "../messages/allowed_mentions.ts";
import { SnakeCaseProps } from "../util.ts";
export interface CreateMessage {
/** The message contents (up to 2000 characters) */
content?: string;
/** A nonce that can be used for optimistic message sending */
nonce?: number | string;
/** true if this is a TTS message */
tts?: boolean;
/** Embedded `rich` content */
embed?: Embed;
/** Allowed mentions for a message */
allowedMentions?: AllowedMentions;
/** Include to make your message a reply */
messageReference?: MessageReference;
}
/** https://discord.com/developers/docs/resources/channel#create-message */
export type DiscordCreateMessage = SnakeCaseProps<CreateMessage>;

View File

@@ -0,0 +1,29 @@
import { SnakeCaseProps } from "../util.ts";
import { DiscordChannelTypes } from "./channel_types.ts";
import { Overwrite } from "./overwrite.ts";
export interface ModifyChannel {
/** 2-100 character channel name */
name?: string;
/** The type of channel; only conversion between text and news is supported and only in guilds with the "NEWS" feature */
type?: DiscordChannelTypes;
/** The position of the channel in the left-hand listing */
position?: number | null;
/** 0-1024 character channel topic */
topic?: string | null;
/** Whether the channel is nsfw */
nsfw?: boolean | null;
/** Amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission `manage_messages` or `manage_channel`, are unaffected */
rateLimitPerUser?: number | null;
/** The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers) */
bitrate?: number | null;
/** The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit */
userLimit?: number | null;
/** Channel or category-specific permissions */
permissionOverwrites?: Overwrite[] | null;
/** id of the new parent category for a channel */
parentId?: string | null;
}
/** https://discord.com/developers/docs/resources/channel#modify-channel */
export type DiscordModifyChannel = SnakeCaseProps<ModifyChannel>;