This commit is contained in:
socram03 2022-06-25 16:35:16 -04:00
parent e188c4e3ad
commit f364d55c59
3 changed files with 8 additions and 5 deletions

5
mod.ts
View File

@ -10,3 +10,8 @@ export * from "./structures/Message.ts";
export * from "./structures/BaseGuild.ts"; export * from "./structures/BaseGuild.ts";
export * from "./structures/Attachment.ts"; export * from "./structures/Attachment.ts";
export * from "./structures/AnonymousGuild.ts"; export * from "./structures/AnonymousGuild.ts";
export * from "./structures/DMChannel.ts";
export * from "./structures/TextChannel.ts";
export * from "./structures/VoiceChannel.ts";
export * from "./structures/ThreadChannel.ts";
export * from "./structures/NewsChannel.ts";

View File

@ -1,6 +1,4 @@
import { Guild } from "./Guild.ts"; import { DiscordChannel, Guild, Session, TextChannel } from "../mod.ts";
import { TextChannel } from "./TextChannel.ts";
import { DiscordChannel, Session } from "../mod.ts";
export class NewsChannel extends TextChannel { export class NewsChannel extends TextChannel {
constructor(session: Session, data: DiscordChannel, guildId: Guild["id"]) { constructor(session: Session, data: DiscordChannel, guildId: Guild["id"]) {

View File

@ -10,7 +10,7 @@ import { GetMessagesOptions } from "../util/Routes.ts";
* https://discord.com/developers/docs/resources/channel#create-channel-invite-json-params * https://discord.com/developers/docs/resources/channel#create-channel-invite-json-params
*/ */
export interface DiscordInvite { export interface DiscordInviteOptions {
max_age?: number; max_age?: number;
max_uses?: number; max_uses?: number;
unique?: boolean; unique?: boolean;
@ -54,7 +54,7 @@ export class TextChannel extends GuildChannel {
return messages[0] ? messages.map((x: DiscordMessage) => new Message(this.session, x)) : []; return messages[0] ? messages.map((x: DiscordMessage) => new Message(this.session, x)) : [];
} }
// TODO return Invite Class // TODO return Invite Class
createInvite(options?: DiscordInvite) { createInvite(options?: DiscordInviteOptions) {
return this.session.rest.runMethod<DiscordInviteCreate>( return this.session.rest.runMethod<DiscordInviteCreate>(
this.session.rest, this.session.rest,
"POST", "POST",