mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-08 08:05:03 +00:00
Various fixes
This commit is contained in:
parent
2c0e4b37ca
commit
cafcc2839e
15 changed files with 45 additions and 68 deletions
|
@ -32,7 +32,7 @@ export const CasesModMsgCmd = modActionsMsgCmd({
|
|||
msg,
|
||||
args.mod,
|
||||
null,
|
||||
msg.author,
|
||||
msg.member,
|
||||
args.notes,
|
||||
args.warns,
|
||||
args.mutes,
|
||||
|
|
|
@ -33,7 +33,7 @@ export const CasesSlashCmd = {
|
|||
interaction,
|
||||
options.mod,
|
||||
options.user,
|
||||
interaction.user,
|
||||
interaction.member,
|
||||
options.notes,
|
||||
options.warns,
|
||||
options.mutes,
|
||||
|
|
|
@ -45,7 +45,7 @@ export const CasesUserMsgCmd = modActionsMsgCmd({
|
|||
msg,
|
||||
args.mod,
|
||||
user,
|
||||
msg.author,
|
||||
msg.member,
|
||||
args.notes,
|
||||
args.warns,
|
||||
args.mutes,
|
||||
|
|
|
@ -24,7 +24,7 @@ export const WarnMsgCmd = modActionsMsgCmd({
|
|||
async run({ pluginData, message: msg, args }) {
|
||||
const user = await resolveUser(pluginData.client, args.user);
|
||||
if (!user.id) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, `User not found`);
|
||||
await pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -33,9 +33,9 @@ export const WarnMsgCmd = modActionsMsgCmd({
|
|||
if (!memberToWarn) {
|
||||
const _isBanned = await isBanned(pluginData, user.id);
|
||||
if (_isBanned) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, `User is banned`);
|
||||
await pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, `User is banned`);
|
||||
} else {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, `User not found on the server`);
|
||||
await pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, `User not found on the server`);
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -43,7 +43,7 @@ export const WarnMsgCmd = modActionsMsgCmd({
|
|||
|
||||
// Make sure we're allowed to warn this member
|
||||
if (!canActOn(pluginData, msg.member, memberToWarn)) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "Cannot warn: insufficient permissions");
|
||||
await pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "Cannot warn: insufficient permissions");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ export const WarnMsgCmd = modActionsMsgCmd({
|
|||
try {
|
||||
contactMethods = readContactMethodsFromArgs(args);
|
||||
} catch (e) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, e.message);
|
||||
await pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, e.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ export const WarnSlashCmd = {
|
|||
const attachments = retrieveMultipleOptions(NUMBER_ATTACHMENTS_CASE_CREATION, options, "attachment");
|
||||
|
||||
if ((!options.reason || options.reason.trim() === "") && attachments.length < 1) {
|
||||
pluginData
|
||||
await pluginData
|
||||
.getPlugin(CommonPlugin)
|
||||
.sendErrorMessage(interaction, "Text or attachment required", undefined, undefined, true);
|
||||
|
||||
|
@ -57,9 +57,9 @@ export const WarnSlashCmd = {
|
|||
if (!memberToWarn) {
|
||||
const _isBanned = await isBanned(pluginData, options.user.id);
|
||||
if (_isBanned) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(interaction, `User is banned`);
|
||||
await pluginData.getPlugin(CommonPlugin).sendErrorMessage(interaction, `User is banned`);
|
||||
} else {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(interaction, `User not found on the server`);
|
||||
await pluginData.getPlugin(CommonPlugin).sendErrorMessage(interaction, `User not found on the server`);
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -67,7 +67,7 @@ export const WarnSlashCmd = {
|
|||
|
||||
// Make sure we're allowed to warn this member
|
||||
if (!canActOn(pluginData, interaction.member, memberToWarn)) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(interaction, "Cannot warn: insufficient permissions");
|
||||
await pluginData.getPlugin(CommonPlugin).sendErrorMessage(interaction, "Cannot warn: insufficient permissions");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ export const WarnSlashCmd = {
|
|||
|
||||
if (options.mod) {
|
||||
if (!canActAsOther) {
|
||||
pluginData
|
||||
await pluginData
|
||||
.getPlugin(CommonPlugin)
|
||||
.sendErrorMessage(interaction, "You don't have permission to act as another moderator");
|
||||
return;
|
||||
|
@ -92,7 +92,7 @@ export const WarnSlashCmd = {
|
|||
try {
|
||||
contactMethods = readContactMethodsFromArgs(options) ?? undefined;
|
||||
} catch (e) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(interaction, e.message);
|
||||
await pluginData.getPlugin(CommonPlugin).sendErrorMessage(interaction, e.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue