the funny

This commit is contained in:
Lara 2024-11-02 14:55:29 +02:00
parent 5a555b7bb0
commit 09a573a2d3
Signed by: laratheprotogen
GPG key ID: 5C0296EB3165F98B
118 changed files with 15738 additions and 24427 deletions

View file

@ -1,6 +1,7 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { isStaffPreFilter, sendErrorMessage } from "../../../pluginUtils";
import { botControlCmd } from "../types";
import { TextBasedChannelFields } from "discord.js";
export const ChannelToServerCmd = botControlCmd({
trigger: ["channel_to_server", "channel2server"],
@ -16,7 +17,7 @@ export const ChannelToServerCmd = botControlCmd({
async run({ pluginData, message: msg, args }) {
const channel = pluginData.client.channels.cache.get(args.channelId);
if (!channel) {
sendErrorMessage(pluginData, msg.channel, "Channel not found in cache!");
await sendErrorMessage(pluginData, msg.channel, "Channel not found in cache!");
return;
}
@ -25,6 +26,8 @@ export const ChannelToServerCmd = botControlCmd({
const guild = "guild" in channel ? channel.guild : null;
const guildInfo = guild ? `${guild.name} (\`${guild.id}\`)` : "Not a server";
msg.channel.send(`**Channel:** ${channelName} (\`${channel.type}\`) (<#${channel.id}>)\n**Server:** ${guildInfo}`);
await (msg.channel as TextBasedChannelFields).send(
`**Channel:** ${channelName} (\`${channel.type}\`) (<#${channel.id}>)\n**Server:** ${guildInfo}`,
);
},
});