More rework progress, remove all eris imports

This commit is contained in:
Dark 2021-06-01 02:05:55 +02:00
parent 8f7a6510eb
commit 52839cc9f3
No known key found for this signature in database
GPG key ID: 2CD6ACB6B0A87B8A
181 changed files with 352 additions and 343 deletions

View file

@ -1,7 +1,7 @@
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
import { BotControlPluginType, ConfigSchema } from "./types";
import { GuildArchives } from "../../data/GuildArchives";
import { TextChannel } from "eris";
import { sendSuccessMessage } from "../../pluginUtils";
import { getActiveReload, resetActiveReload } from "./activeReload";
import { ReloadGlobalPluginsCmd } from "./commands/ReloadGlobalPluginsCmd";
@ -18,6 +18,7 @@ import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments";
import { ListDashboardUsersCmd } from "./commands/ListDashboardUsersCmd";
import { ListDashboardPermsCmd } from "./commands/ListDashboardPermsCmd";
import { EligibleCmd } from "./commands/EligibleCmd";
import { TextChannel } from "discord.js";
const defaultOptions = {
config: {
@ -47,7 +48,7 @@ export const BotControlPlugin = zeppelinGlobalPlugin<BotControlPluginType>()({
EligibleCmd,
],
afterLoad(pluginData) {
async afterLoad(pluginData) {
pluginData.state.archives = new GuildArchives(0);
pluginData.state.allowedGuilds = new AllowedGuilds();
pluginData.state.configs = new Configs();
@ -58,9 +59,9 @@ export const BotControlPlugin = zeppelinGlobalPlugin<BotControlPluginType>()({
const [guildId, channelId] = activeReload;
resetActiveReload();
const guild = pluginData.client.guilds.get(guildId);
const guild = await pluginData.client.guilds.fetch(guildId);
if (guild) {
const channel = guild.channels.get(channelId);
const channel = guild.channels.cache.get(channelId);
if (channel instanceof TextChannel) {
sendSuccessMessage(pluginData, channel, "Global plugins reloaded!");
}