UNPKG

2.46 kBTypeScriptView Raw
1import { Client } from "discord.js";
2import CommandSystem, { PermissionSetEntityStub } from "./commands";
3import { Context } from "./commands/commands";
4import BKConstants from "./Constants";
5import "./node-additions";
6import "./override";
7export interface RoleOptions {
8 moderator: string[];
9 admin: string[];
10 root: string[];
11}
12export interface ApplicationOptions<T extends PermissionSetEntityStub> {
13 /**
14 * discord token. required unless you pass a client which has already been logged-in
15 */
16 token?: string;
17 /**
18 * discord client. if not passed, the application will create one.
19 */
20 client?: Client;
21 /**
22 * directory to load command files from
23 */
24 commandDirectory?: string;
25 /**
26 * whether or not command categories should default to their parent folder name.
27 * default is false
28 */
29 automaticCategoryNames?: boolean;
30 /**
31 * message prefix for commands
32 */
33 commandPrefix?: typeof Constants['COMMAND_PREFIX'];
34 /**
35 * whether to render errors in plaintext or embeds
36 */
37 errorFormat?: BKConstants.ErrorFormat;
38 /**
39 * Commands to exclude from bot loading
40 */
41 preloadExclude?: string[];
42 /**
43 * Function that adds additional variables to eval contexts
44 */
45 contextPopulator?: (context: Context) => Context;
46 /**
47 * The permissions entity that BotKit should query to determine command accessibility
48 */
49 permissionsEntity?: T;
50 /**
51 * The reference to the superusers on this instance
52 */
53 superuserCheck?: (id: string) => boolean;
54 /**
55 * Advanced overrides. Do not modify things without knowing what they do.
56 */
57 overrides?: {
58 commandSystem?: {
59 features?: {
60 nodeBasedPermissions?: false;
61 superuserPermissions?: false;
62 };
63 };
64 };
65}
66/**
67 * Initializes the framework
68 */
69export declare class Application<T extends PermissionSetEntityStub = PermissionSetEntityStub> {
70 options: ApplicationOptions<T>;
71 readonly client: Client;
72 readonly commandSystem: CommandSystem;
73 constructor(options: ApplicationOptions<T>);
74 /**
75 * Sets the Discord client up and loads the command system
76 */
77 init(): Promise<void>;
78}
79export default Application;
80export * from "./commands";
81export declare const Constants: typeof BKConstants;
82export * from "./db";
83export * from "./modules";
84export * from "./util";