discord-tickets
Version:
Discord.js extention library for manage easily tickets
64 lines (63 loc) • 2.01 kB
TypeScript
/// <reference types="node" />
import { EventEmitter } from 'events';
/**
* @external Client
* @see {@link https://discord.js.org/#/docs/main/stable/class/Client}
*/
/**
* @external Guild
* @see {@link https://discord.js.org/#/docs/main/stable/class/Guild}
*/
import { Client, Guild } from "discord.js";
import { BaseManagerOptions, TicketData } from "../types/types";
/**
* Ticket Manager
* @extends {EventEmitter}
*/
export declare class BaseManager extends EventEmitter {
readonly client: Client;
options: BaseManagerOptions;
ticketRaws: Array<TicketData>;
/**
* @param {Client} client Discord Client
* @param {TicketManagerOptions} [options] TicketManager options
*/
constructor(client: Client, options?: BaseManagerOptions);
/**
* Get All ticket raw from Database/JSON storage
* @return {Promise<Array<TicketData>>}
*/
getAllTickets(): Promise<Array<TicketData>>;
/**
* Save all tickets on Database/JSON storage
* @return {Promise<boolean>}
*/
saveTicketRaws(): Promise<boolean>;
/**
* Check if member already has ticket
* @param {string} guildID Discord Guild Id
* @param {string} memberID Discord Guild Member Id
* @return {boolean}
*/
checkDoubleTickets(guildID: string, memberID: string): boolean;
/**
* Get Guild Class from client cache (is you're using shards)
* @param {string} id Discord Guild Id
* @return {Promise<Guild>}
*/
getGuild(id: string): Guild | undefined;
}
/**
* Storage File path:
* * "Json file path"
* * "custom"
* @typedef {string} StorageType
*/
/**
* Base Manager Config Types
* @typedef {object} BaseManagerOptions
* @property {boolean} enabled Manager status
* @property {string} staffRole Discord Role id who can access to tickets
* @property {boolean} ticketCache Storing tickets in the cache
* @property {StorageType} storage Storage File path
*/