mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-18 09:17:22 +00:00
fix: double Invite declarations
This commit is contained in:
Vendored
+5
-1
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user