mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 13:55:03 +00:00
Added Discord attachment link reaction, fixed emoji configuration and moved util functions
This commit is contained in:
parent
a4c4b17a14
commit
592d037148
173 changed files with 1540 additions and 1170 deletions
|
@ -1,6 +1,7 @@
|
|||
import { commandTypeHelpers as ct } from "../../../../commandTypes";
|
||||
import { hasPermission, sendErrorMessage } from "../../../../pluginUtils";
|
||||
import { hasPermission } from "../../../../pluginUtils";
|
||||
import { resolveUser } from "../../../../utils";
|
||||
import { CommonPlugin } from "../../../Common/CommonPlugin";
|
||||
import { actualUnbanCmd } from "../../functions/actualCommands/actualUnbanCmd";
|
||||
import { modActionsMsgCmd } from "../../types";
|
||||
|
||||
|
@ -25,7 +26,7 @@ export const UnbanMsgCmd = modActionsMsgCmd({
|
|||
async run({ pluginData, message: msg, args }) {
|
||||
const user = await resolveUser(pluginData.client, args.user);
|
||||
if (!user.id) {
|
||||
sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -33,13 +34,13 @@ export const UnbanMsgCmd = modActionsMsgCmd({
|
|||
let mod = msg.member;
|
||||
if (args.mod) {
|
||||
if (!(await hasPermission(pluginData, "can_act_as_other", { message: msg, channelId: msg.channel.id }))) {
|
||||
sendErrorMessage(pluginData, msg.channel, "You don't have permission to use -mod");
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "You don't have permission to use -mod");
|
||||
return;
|
||||
}
|
||||
|
||||
mod = args.mod;
|
||||
}
|
||||
|
||||
actualUnbanCmd(pluginData, msg.channel, msg.author.id, user, args.reason, [...msg.attachments.values()], mod);
|
||||
actualUnbanCmd(pluginData, msg, msg.author.id, user, args.reason, [...msg.attachments.values()], mod);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { slashOptions } from "knub";
|
||||
import { hasPermission, sendErrorMessage } from "../../../../pluginUtils";
|
||||
import { hasPermission } from "../../../../pluginUtils";
|
||||
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
|
||||
import { CommonPlugin } from "../../../Common/CommonPlugin";
|
||||
import { actualUnbanCmd } from "../../functions/actualCommands/actualUnbanCmd";
|
||||
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
|
||||
|
||||
|
@ -25,7 +26,9 @@ export const UnbanSlashCmd = {
|
|||
const attachments = retrieveMultipleOptions(NUMBER_ATTACHMENTS_CASE_CREATION, options, "attachment");
|
||||
|
||||
if ((!options.reason || options.reason.trim() === "") && attachments.length < 1) {
|
||||
sendErrorMessage(pluginData, interaction, "Text or attachment required", undefined, undefined, true);
|
||||
pluginData
|
||||
.getPlugin(CommonPlugin)
|
||||
.sendErrorMessage(interaction, "Text or attachment required", undefined, undefined, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -38,7 +41,9 @@ export const UnbanSlashCmd = {
|
|||
|
||||
if (options.mod) {
|
||||
if (!canActAsOther) {
|
||||
sendErrorMessage(pluginData, interaction, "You don't have permission to act as another moderator");
|
||||
pluginData
|
||||
.getPlugin(CommonPlugin)
|
||||
.sendErrorMessage(interaction, "You don't have permission to act as another moderator");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue