From 8c5fcbfefa732a94fbe559069127066dafcea03e Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Sun, 28 Aug 2022 11:29:25 +0000 Subject: [PATCH] fix: double Invite declarations --- .vscode/settings.json | 6 +++++- helpers/invites/createInvite.ts | 4 ++-- helpers/invites/getInvite.ts | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index c171e0a34..97de829af 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,7 +15,11 @@ "./tests", "./transformers", "./types", - "./util" + "./util", + "dnt.ts", + "mod.ts", + "debug.ts", + "bot.ts" ], "editor.defaultFormatter": "denoland.vscode-deno", "editor.formatOnSave": true, diff --git a/helpers/invites/createInvite.ts b/helpers/invites/createInvite.ts index 60a98b829..47e1d4d1d 100644 --- a/helpers/invites/createInvite.ts +++ b/helpers/invites/createInvite.ts @@ -1,10 +1,10 @@ import type { Bot } from "../../bot.ts"; import { DiscordInvite } from "../../types/discord.ts"; import { TargetTypes } from "../../types/shared.ts"; -import { Invite } from "./getInvite.ts"; +import { BaseInvite } from "./getInvite.ts"; /** Creates a new invite for this channel. Requires CREATE_INSTANT_INVITE */ -export async function createInvite(bot: Bot, channelId: bigint, options: CreateChannelInvite = {}): Promise { +export async function createInvite(bot: Bot, channelId: bigint, options: CreateChannelInvite = {}): Promise { const result = await bot.rest.runMethod( bot.rest, "POST", diff --git a/helpers/invites/getInvite.ts b/helpers/invites/getInvite.ts index 30bfd5e07..7002fc6da 100644 --- a/helpers/invites/getInvite.ts +++ b/helpers/invites/getInvite.ts @@ -2,7 +2,7 @@ import type { Bot } from "../../bot.ts"; import { ScheduledEvent, TargetTypes, User } from "../../mod.ts"; import { DiscordInviteMetadata } from "../../types/discord.ts"; -export type Invite = { +export type BaseInvite = { code: string; guildId?: bigint; channelId?: bigint; @@ -16,7 +16,7 @@ export type Invite = { guildScheduledEvent?: ScheduledEvent; }; -export type InviteMetadata = Invite & { +export type InviteMetadata = BaseInvite & { uses: number; maxUses: number; maxAge: number; @@ -25,7 +25,7 @@ export type InviteMetadata = Invite & { }; /** Returns an invite for the given code or throws an error if the invite doesn't exists. */ -export async function getInvite(bot: Bot, inviteCode: string, options?: GetInvite): Promise { +export async function getInvite(bot: Bot, inviteCode: string, options?: GetInvite): Promise { const result = await bot.rest.runMethod( bot.rest, "GET",