mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-11 20:55:01 +00:00
Update to new Knub 30 beta. Code clean-up.
This commit is contained in:
parent
5d579446c5
commit
2f470dc37a
299 changed files with 1075 additions and 1004 deletions
|
@ -1,8 +1,8 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { zeppelinPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { ConfigSchema, PersistPluginType } from "./types";
|
||||
import { GuildPersistedData } from "src/data/GuildPersistedData";
|
||||
import { GuildLogs } from "src/data/GuildLogs";
|
||||
import { GuildPersistedData } from "../../data/GuildPersistedData";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { StoreDataEvt } from "./events/StoreDataEvt";
|
||||
import { LoadDataEvt } from "./events/LoadDataEvt";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
|
@ -16,7 +16,7 @@ const defaultOptions: PluginOptions<PersistPluginType> = {
|
|||
},
|
||||
};
|
||||
|
||||
export const PersistPlugin = zeppelinPlugin<PersistPluginType>()("persist", {
|
||||
export const PersistPlugin = zeppelinGuildPlugin<PersistPluginType>()("persist", {
|
||||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Persist",
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { persistEvent } from "../types";
|
||||
import { persistEvt } from "../types";
|
||||
import { Constants, MemberOptions } from "eris";
|
||||
import intersection from "lodash.intersection";
|
||||
import { LogType } from "src/data/LogType";
|
||||
import { stripObjectToScalars } from "src/utils";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { stripObjectToScalars } from "../../../utils";
|
||||
import { getMissingPermissions } from "../../../utils/getMissingPermissions";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { missingPermissionError } from "../../../utils/missingPermissionError";
|
||||
|
@ -10,7 +10,7 @@ import { canAssignRole } from "../../../utils/canAssignRole";
|
|||
|
||||
const p = Constants.Permissions;
|
||||
|
||||
export const LoadDataEvt = persistEvent({
|
||||
export const LoadDataEvt = persistEvt({
|
||||
event: "guildMemberAdd",
|
||||
|
||||
async listener(meta) {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { persistEvent } from "../types";
|
||||
import { IPartialPersistData } from "src/data/GuildPersistedData";
|
||||
import { persistEvt } from "../types";
|
||||
import { IPartialPersistData } from "../../../data/GuildPersistedData";
|
||||
import { Member } from "eris";
|
||||
import intersection from "lodash.intersection";
|
||||
|
||||
export const StoreDataEvt = persistEvent({
|
||||
export const StoreDataEvt = persistEvt({
|
||||
event: "guildMemberRemove",
|
||||
|
||||
async listener(meta) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as t from "io-ts";
|
||||
import { BasePluginType, eventListener } from "knub";
|
||||
import { GuildPersistedData } from "src/data/GuildPersistedData";
|
||||
import { GuildLogs } from "src/data/GuildLogs";
|
||||
import { BasePluginType, guildEventListener } from "knub";
|
||||
import { GuildPersistedData } from "../../data/GuildPersistedData";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
|
||||
export const ConfigSchema = t.type({
|
||||
persisted_roles: t.array(t.string),
|
||||
|
@ -19,4 +19,4 @@ export interface PersistPluginType extends BasePluginType {
|
|||
};
|
||||
}
|
||||
|
||||
export const persistEvent = eventListener<PersistPluginType>();
|
||||
export const persistEvt = guildEventListener<PersistPluginType>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue