mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-07 08:05:01 +00:00
29 lines
911 B
TypeScript
29 lines
911 B
TypeScript
import { guildPlugin } from "knub";
|
|
import { Queue } from "../../Queue.js";
|
|
import { Webhooks } from "../../data/Webhooks.js";
|
|
import { makePublicFn } from "../../pluginUtils.js";
|
|
import { editMessage } from "./functions/editMessage.js";
|
|
import { sendMessage } from "./functions/sendMessage.js";
|
|
import { InternalPosterPluginType, zInternalPosterConfig } from "./types.js";
|
|
|
|
export const InternalPosterPlugin = guildPlugin<InternalPosterPluginType>()({
|
|
name: "internal_poster",
|
|
|
|
configSchema: zInternalPosterConfig,
|
|
|
|
public(pluginData) {
|
|
return {
|
|
sendMessage: makePublicFn(pluginData, sendMessage),
|
|
editMessage: makePublicFn(pluginData, editMessage),
|
|
};
|
|
},
|
|
|
|
async beforeLoad(pluginData) {
|
|
const { state } = pluginData;
|
|
|
|
state.webhooks = new Webhooks();
|
|
state.queue = new Queue();
|
|
state.missingPermissions = false;
|
|
state.webhookClientCache = new Map();
|
|
},
|
|
});
|