mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 05:45:02 +00:00
Finish preliminary rework, ready to test
This commit is contained in:
parent
57893e7f76
commit
d0a1beb809
177 changed files with 854 additions and 707 deletions
|
@ -1,6 +1,7 @@
|
|||
import { botControlCmd } from "../types";
|
||||
import { isOwnerPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { TextChannel } from "discord.js";
|
||||
|
||||
export const ReloadServerCmd = botControlCmd({
|
||||
trigger: ["reload_server", "reload_guild"],
|
||||
|
@ -14,19 +15,19 @@ export const ReloadServerCmd = botControlCmd({
|
|||
},
|
||||
|
||||
async run({ pluginData, message: msg, args }) {
|
||||
if (!pluginData.client.guilds.has(args.guildId)) {
|
||||
sendErrorMessage(pluginData, msg.channel, "I am not in that guild");
|
||||
if (!pluginData.client.guilds.cache.has(args.guildId)) {
|
||||
sendErrorMessage(pluginData, msg.channel as TextChannel, "I am not in that guild");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await pluginData.getKnubInstance().reloadGuild(args.guildId);
|
||||
} catch (e) {
|
||||
sendErrorMessage(pluginData, msg.channel, `Failed to reload guild: ${e.message}`);
|
||||
sendErrorMessage(pluginData, msg.channel as TextChannel, `Failed to reload guild: ${e.message}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const guild = pluginData.client.guilds.get(args.guildId);
|
||||
sendSuccessMessage(pluginData, msg.channel, `Reloaded guild **${guild?.name || "???"}**`);
|
||||
const guild = await pluginData.client.guilds.fetch(args.guildId);
|
||||
sendSuccessMessage(pluginData, msg.channel as TextChannel, `Reloaded guild **${guild?.name || "???"}**`);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue