fix: double Invite declarations

This commit is contained in:
Skillz4Killz
2022-08-28 11:29:25 +00:00
committed by GitHub
parent d0b0884b89
commit 8c5fcbfefa
3 changed files with 10 additions and 6 deletions
+5 -1
View File
@@ -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,
+2 -2
View File
@@ -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<Invite> {
export async function createInvite(bot: Bot, channelId: bigint, options: CreateChannelInvite = {}): Promise<BaseInvite> {
const result = await bot.rest.runMethod<DiscordInvite>(
bot.rest,
"POST",
+3 -3
View File
@@ -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<Invite> {
export async function getInvite(bot: Bot, inviteCode: string, options?: GetInvite): Promise<BaseInvite> {
const result = await bot.rest.runMethod<DiscordInviteMetadata>(
bot.rest,
"GET",