Add types for all plugin configs and permissions. Update code to work with Knub 18.
This commit is contained in:
parent
c96e98fcef
commit
b7b42705f9
22 changed files with 415 additions and 225 deletions
|
@ -1,17 +1,25 @@
|
|||
import { Plugin, decorators as d } from "knub";
|
||||
import { Plugin, decorators as d, IBasePluginConfig, IPluginOptions } from "knub";
|
||||
import { GuildChannel, Message, TextChannel, Constants as ErisConstants, User } from "eris";
|
||||
import { convertDelayStringToMS, errorMessage, noop, successMessage } from "../utils";
|
||||
import { GuildSlowmodes } from "../data/GuildSlowmodes";
|
||||
import humanizeDuration from "humanize-duration";
|
||||
import { ZeppelinPlugin } from "./ZeppelinPlugin";
|
||||
|
||||
export class SlowmodePlugin extends Plugin {
|
||||
interface ISlowmodePluginPermissions {
|
||||
manage: boolean;
|
||||
affected: boolean;
|
||||
}
|
||||
|
||||
export class SlowmodePlugin extends ZeppelinPlugin<IBasePluginConfig, ISlowmodePluginPermissions> {
|
||||
public static pluginName = "slowmode";
|
||||
|
||||
protected slowmodes: GuildSlowmodes;
|
||||
protected clearInterval;
|
||||
|
||||
getDefaultOptions() {
|
||||
getDefaultOptions(): IPluginOptions<IBasePluginConfig, ISlowmodePluginPermissions> {
|
||||
return {
|
||||
config: {},
|
||||
|
||||
permissions: {
|
||||
manage: false,
|
||||
affected: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue