mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-17 15:15:02 +00:00
Add types for all plugin configs and permissions. Update code to work with Knub 18.
This commit is contained in:
parent
056cb9809f
commit
1c77269643
22 changed files with 415 additions and 225 deletions
|
@ -1,14 +1,20 @@
|
|||
import { Plugin, decorators as d } from "knub";
|
||||
import { Plugin, decorators as d, IBasePluginConfig, IPluginOptions } from "knub";
|
||||
import { Channel, EmbedBase, Message, Role, TextChannel } from "eris";
|
||||
import { errorMessage, downloadFile, roleMentionRegex, getRoleMentions } from "../utils";
|
||||
import { errorMessage, downloadFile, getRoleMentions } from "../utils";
|
||||
import { GuildSavedMessages } from "../data/GuildSavedMessages";
|
||||
import { ZeppelinPlugin } from "./ZeppelinPlugin";
|
||||
|
||||
import fs from "fs";
|
||||
const fsp = fs.promises;
|
||||
|
||||
const COLOR_MATCH_REGEX = /^#?([0-9a-f]{6})$/;
|
||||
|
||||
export class PostPlugin extends Plugin {
|
||||
interface IPostPluginPermissions {
|
||||
post: boolean;
|
||||
edit: boolean;
|
||||
}
|
||||
|
||||
export class PostPlugin extends ZeppelinPlugin<IBasePluginConfig, IPostPluginPermissions> {
|
||||
public static pluginName = "post";
|
||||
|
||||
protected savedMessages: GuildSavedMessages;
|
||||
|
@ -17,8 +23,10 @@ export class PostPlugin extends Plugin {
|
|||
this.savedMessages = GuildSavedMessages.getInstance(this.guildId);
|
||||
}
|
||||
|
||||
getDefaultOptions() {
|
||||
getDefaultOptions(): IPluginOptions<IBasePluginConfig, IPostPluginPermissions> {
|
||||
return {
|
||||
config: {},
|
||||
|
||||
permissions: {
|
||||
post: false,
|
||||
edit: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue