mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-07 19:17:19 +00:00
Fixes, refactoring and PR feedback
This commit is contained in:
parent
0be54912c4
commit
893a77d562
202 changed files with 1037 additions and 1069 deletions
|
@ -3,6 +3,7 @@ import z from "zod";
|
|||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { ArchiveChannelCmd } from "./commands/ArchiveChannelCmd";
|
||||
import { ChannelArchiverPluginType } from "./types";
|
||||
import { CommonPlugin } from "../Common/CommonPlugin";
|
||||
|
||||
export const ChannelArchiverPlugin = guildPlugin<ChannelArchiverPluginType>()({
|
||||
name: "channel_archiver",
|
||||
|
@ -14,4 +15,8 @@ export const ChannelArchiverPlugin = guildPlugin<ChannelArchiverPluginType>()({
|
|||
messageCommands: [
|
||||
ArchiveChannelCmd,
|
||||
],
|
||||
|
||||
beforeStart(pluginData) {
|
||||
pluginData.state.common = pluginData.getPlugin(CommonPlugin);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -38,7 +38,7 @@ export const ArchiveChannelCmd = channelArchiverCmd({
|
|||
"No `-attachment-channel` specified. Continue? Attachments will not be available in the log if their message is deleted.",
|
||||
});
|
||||
if (!confirmed) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "Canceled");
|
||||
void pluginData.state.common.sendErrorMessage(msg, "Canceled");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
import { BasePluginType, guildPluginMessageCommand } from "knub";
|
||||
import { BasePluginType, guildPluginMessageCommand, pluginUtils } from "knub";
|
||||
import { CommonPlugin } from "../Common/CommonPlugin";
|
||||
|
||||
export interface ChannelArchiverPluginType extends BasePluginType {}
|
||||
export interface ChannelArchiverPluginType extends BasePluginType {
|
||||
state: {
|
||||
common: pluginUtils.PluginPublicInterface<typeof CommonPlugin>;
|
||||
}
|
||||
}
|
||||
|
||||
export const channelArchiverCmd = guildPluginMessageCommand<ChannelArchiverPluginType>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue