2020-06-30 17:48:18 +03:00
|
|
|
import { BaseConfig, Knub } from "knub";
|
2020-08-10 00:24:06 +03:00
|
|
|
import * as t from "io-ts";
|
2020-11-09 20:03:57 +02:00
|
|
|
import { Message } from "eris";
|
2020-01-12 13:37:43 +02:00
|
|
|
|
2020-08-10 00:24:06 +03:00
|
|
|
export interface ZeppelinGuildConfig extends BaseConfig<any> {
|
2020-01-12 13:44:31 +02:00
|
|
|
success_emoji?: string;
|
|
|
|
error_emoji?: string;
|
2020-08-19 00:19:12 +03:00
|
|
|
|
|
|
|
// Deprecated
|
2020-08-10 00:24:06 +03:00
|
|
|
timezone?: string;
|
2020-08-19 00:19:12 +03:00
|
|
|
date_formats?: any;
|
2020-01-12 13:37:43 +02:00
|
|
|
}
|
|
|
|
|
2020-08-10 00:24:06 +03:00
|
|
|
export const ZeppelinGuildConfigSchema = t.type({
|
|
|
|
// From BaseConfig
|
|
|
|
prefix: t.string,
|
|
|
|
levels: t.record(t.string, t.number),
|
|
|
|
plugins: t.record(t.string, t.unknown),
|
|
|
|
|
|
|
|
// From ZeppelinGuildConfig
|
|
|
|
success_emoji: t.string,
|
|
|
|
error_emoji: t.string,
|
2020-08-19 00:19:12 +03:00
|
|
|
|
|
|
|
// Deprecated
|
2020-08-10 00:24:06 +03:00
|
|
|
timezone: t.string,
|
2020-08-19 00:19:12 +03:00
|
|
|
date_formats: t.unknown,
|
2020-08-10 00:24:06 +03:00
|
|
|
});
|
|
|
|
export const PartialZeppelinGuildConfigSchema = t.partial(ZeppelinGuildConfigSchema.props);
|
|
|
|
|
|
|
|
export interface ZeppelinGlobalConfig extends BaseConfig<any> {
|
2020-01-12 13:37:43 +02:00
|
|
|
url: string;
|
|
|
|
owners?: string[];
|
|
|
|
}
|
|
|
|
|
2020-08-10 00:24:06 +03:00
|
|
|
export const ZeppelinGlobalConfigSchema = t.type({
|
|
|
|
url: t.string,
|
|
|
|
owners: t.array(t.string),
|
|
|
|
plugins: t.record(t.string, t.unknown),
|
|
|
|
});
|
|
|
|
|
|
|
|
export type TZeppelinKnub = Knub<ZeppelinGuildConfig, ZeppelinGlobalConfig>;
|
2020-07-05 05:00:54 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Wrapper for the string type that indicates the text will be parsed as Markdown later
|
|
|
|
*/
|
2020-07-22 23:11:42 +03:00
|
|
|
export type TMarkdown = string;
|
2020-07-05 05:00:54 +03:00
|
|
|
|
|
|
|
export interface ZeppelinPluginInfo {
|
|
|
|
prettyName: string;
|
|
|
|
description?: TMarkdown;
|
|
|
|
usageGuide?: TMarkdown;
|
|
|
|
configurationGuide?: TMarkdown;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface CommandInfo {
|
|
|
|
description?: TMarkdown;
|
|
|
|
basicUsage?: TMarkdown;
|
|
|
|
examples?: TMarkdown;
|
|
|
|
usageGuide?: TMarkdown;
|
|
|
|
parameterDescriptions?: {
|
|
|
|
[key: string]: TMarkdown;
|
|
|
|
};
|
|
|
|
optionDescriptions?: {
|
|
|
|
[key: string]: TMarkdown;
|
|
|
|
};
|
|
|
|
}
|