3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-14 22:05:01 +00:00

Added Discord attachment link reaction, fixed emoji configuration and moved util functions

This commit is contained in:
Lily Bergonzat 2024-02-16 11:51:58 +01:00
parent a4c4b17a14
commit 592d037148
173 changed files with 1540 additions and 1170 deletions

View file

@ -1,7 +1,8 @@
import { VoiceChannel } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { canActOn } from "../../../pluginUtils";
import { renderUserUsername } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { utilityCmd } from "../types";
@ -17,12 +18,12 @@ export const VcdisconnectCmd = utilityCmd({
async run({ message: msg, args, pluginData }) {
if (!canActOn(pluginData, msg.member, args.member)) {
sendErrorMessage(pluginData, msg.channel, "Cannot move: insufficient permissions");
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "Cannot move: insufficient permissions");
return;
}
if (!args.member.voice?.channelId) {
sendErrorMessage(pluginData, msg.channel, "Member is not in a voice channel");
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "Member is not in a voice channel");
return;
}
const channel = pluginData.guild.channels.cache.get(args.member.voice.channelId) as VoiceChannel;
@ -30,7 +31,7 @@ export const VcdisconnectCmd = utilityCmd({
try {
await args.member.voice.disconnect();
} catch {
sendErrorMessage(pluginData, msg.channel, "Failed to disconnect member");
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "Failed to disconnect member");
return;
}
@ -40,10 +41,8 @@ export const VcdisconnectCmd = utilityCmd({
oldChannel: channel,
});
sendSuccessMessage(
pluginData,
msg.channel,
`**${renderUserUsername(args.member.user)}** disconnected from **${channel.name}**`,
);
pluginData
.getPlugin(CommonPlugin)
.sendSuccessMessage(msg, `**${renderUserUsername(args.member.user)}** disconnected from **${channel.name}**`);
},
});