mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-14 05:57:18 +00:00
Resolve issues mentioned in #139 comments
This commit is contained in:
parent
37cdb2e66b
commit
c11218d68f
4 changed files with 9 additions and 6 deletions
|
@ -177,4 +177,8 @@ export const ModActionsPlugin = zeppelinGuildPlugin<ModActionsPluginType>()("mod
|
|||
|
||||
outdatedTempbansLoop(pluginData);
|
||||
},
|
||||
|
||||
onUnload(pluginData) {
|
||||
pluginData.state.unloaded = true;
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { modActionsCmd, IgnoredEventType } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { canActOn, sendErrorMessage, hasPermission, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { resolveUser, resolveMember, stripObjectToScalars } from "../../../utils";
|
||||
import { resolveUser, resolveMember, stripObjectToScalars, noop } from "../../../utils";
|
||||
import { isBanned } from "../functions/isBanned";
|
||||
import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
|
@ -46,7 +46,6 @@ export const BanCmd = modActionsCmd({
|
|||
return sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
}
|
||||
const time = args["time"] ? args["time"] : null;
|
||||
console.log(time);
|
||||
|
||||
const reason = formatReasonWithAttachments(args.reason, msg.attachments);
|
||||
const memberToBan = await resolveMember(pluginData.client, pluginData.guild, user.id);
|
||||
|
@ -78,7 +77,7 @@ export const BanCmd = modActionsCmd({
|
|||
const alreadyBannedMsg = await msg.channel.createMessage("User is already banned, update ban?");
|
||||
const reply = await waitForReaction(pluginData.client, alreadyBannedMsg, ["✅", "❌"], msg.author.id);
|
||||
|
||||
alreadyBannedMsg.delete();
|
||||
alreadyBannedMsg.delete().catch(noop);
|
||||
if (!reply || reply.name === "❌") {
|
||||
sendErrorMessage(pluginData, msg.channel, "User already banned, update cancelled by moderator");
|
||||
lock.unlock();
|
||||
|
@ -126,7 +125,7 @@ export const BanCmd = modActionsCmd({
|
|||
const notOnServerMsg = await msg.channel.createMessage("User not found on the server, forceban instead?");
|
||||
const reply = await waitForReaction(pluginData.client, notOnServerMsg, ["✅", "❌"], msg.author.id);
|
||||
|
||||
notOnServerMsg.delete();
|
||||
notOnServerMsg.delete().catch(noop);
|
||||
if (!reply || reply.name === "❌") {
|
||||
sendErrorMessage(pluginData, msg.channel, "User not on server, ban cancelled by moderator");
|
||||
lock.unlock();
|
||||
|
|
|
@ -104,7 +104,7 @@ export async function banUserId(
|
|||
const noteDetails: string[] = [];
|
||||
const timeUntilUnban = banTime ? humanizeDuration(banTime) : "indefinite";
|
||||
const timeDetails = `Banned ${banTime ? `for ${timeUntilUnban}` : "indefinitely"}`;
|
||||
if (notifyResult.text) noteDetails.push(notifyResult.text);
|
||||
if (notifyResult.text) noteDetails.push(ucfirst(notifyResult.text));
|
||||
noteDetails.push(timeDetails);
|
||||
|
||||
const createdCase = await casesPlugin.createCase({
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"scripts": {
|
||||
"build": "rimraf dist && cross-env NODE_ENV=production webpack --config webpack.config.js",
|
||||
"build-debug": "rimraf dist && cross-env NODE_ENV=development webpack --config webpack.config.js",
|
||||
"watch": "cross-env NODE_ENV=development webpack-dev-server --disable-host-check",
|
||||
"watch": "cross-env NODE_ENV=development webpack-dev-server",
|
||||
"watch-build": "rimraf dist && NODE_ENV=development webpack --config webpack.config.js --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue