mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-11 04:45:02 +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,7 +1,7 @@
|
|||
import { zeppelinPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { PluginOptions } from "knub";
|
||||
import { ConfigSchema, WelcomeMessagePluginType } from "./types";
|
||||
import { GuildLogs } from "src/data/GuildLogs";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { SendWelcomeMessageEvt } from "./events/SendWelcomeMessageEvt";
|
||||
|
||||
const defaultOptions: PluginOptions<WelcomeMessagePluginType> = {
|
||||
|
@ -12,7 +12,7 @@ const defaultOptions: PluginOptions<WelcomeMessagePluginType> = {
|
|||
},
|
||||
};
|
||||
|
||||
export const WelcomeMessagePlugin = zeppelinPlugin<WelcomeMessagePluginType>()("welcome_message", {
|
||||
export const WelcomeMessagePlugin = zeppelinGuildPlugin<WelcomeMessagePluginType>()("welcome_message", {
|
||||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Welcome message",
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { welcomeEvent } from "../types";
|
||||
import { renderTemplate, TemplateParseError } from "src/templateFormatter";
|
||||
import { createChunkedMessage, stripObjectToScalars } from "src/utils";
|
||||
import { LogType } from "src/data/LogType";
|
||||
import { welcomeMessageEvt } from "../types";
|
||||
import { renderTemplate, TemplateParseError } from "../../../templateFormatter";
|
||||
import { createChunkedMessage, stripObjectToScalars } from "../../../utils";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { TextChannel } from "eris";
|
||||
import { sendDM } from "../../../utils/sendDM";
|
||||
|
||||
export const SendWelcomeMessageEvt = welcomeEvent({
|
||||
export const SendWelcomeMessageEvt = welcomeMessageEvt({
|
||||
event: "guildMemberAdd",
|
||||
|
||||
async listener(meta) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as t from "io-ts";
|
||||
import { BasePluginType, eventListener } from "knub";
|
||||
import { tNullable } from "src/utils";
|
||||
import { GuildLogs } from "src/data/GuildLogs";
|
||||
import { BasePluginType, guildEventListener } from "knub";
|
||||
import { tNullable } from "../../utils";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
|
||||
export const ConfigSchema = t.type({
|
||||
send_dm: t.boolean,
|
||||
|
@ -18,4 +18,4 @@ export interface WelcomeMessagePluginType extends BasePluginType {
|
|||
};
|
||||
}
|
||||
|
||||
export const welcomeEvent = eventListener<WelcomeMessagePluginType>();
|
||||
export const welcomeMessageEvt = guildEventListener<WelcomeMessagePluginType>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue