mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-19 22:20:34 +00:00
Could simplify this to one variable instead
This commit is contained in:
parent
9c7c3d0c5d
commit
8a09cb533b
1 changed files with 3 additions and 8 deletions
|
@ -13,7 +13,6 @@ import { RestAPI } from "@webpack/common";
|
|||
const Native = VencordNative.pluginHelpers.WebhookManager as PluginNative<typeof import("./native")>;
|
||||
const WMLogger = new Logger("WebhookManager");
|
||||
let sourceGuildGet;
|
||||
let sourceChannelGet;
|
||||
export default definePlugin({
|
||||
name: "WebhookManager",
|
||||
description: "Manage your webhooks easily; delete, send messages, get detailed info and more.",
|
||||
|
@ -74,20 +73,16 @@ export default definePlugin({
|
|||
.then(response => {
|
||||
WMLogger.info(JSON.stringify(response));
|
||||
if (response.type === 2) {
|
||||
const sourceGuild = `
|
||||
const sourceWebhook = `
|
||||
Source Server ID: ${response.source_guild.id}
|
||||
Source Server Name: ${response.source_guild.name}
|
||||
`;
|
||||
sourceGuildGet = sourceGuild;
|
||||
const sourceChannel = `
|
||||
Source Channel ID: ${response.source_channel.id}
|
||||
Source Channel Name: ${response.source_channel.name}
|
||||
`;
|
||||
sourceChannelGet = sourceChannel;
|
||||
sourceGuildGet = sourceWebhook;
|
||||
}
|
||||
else {
|
||||
sourceGuildGet = "";
|
||||
sourceChannelGet = "";
|
||||
}
|
||||
sendBotMessage(ctx.channel.id, {
|
||||
content: `This webhook was created by <@${response.user.id}>.`,
|
||||
|
@ -110,7 +105,6 @@ export default definePlugin({
|
|||
Channel ID: ${response.channel_id}
|
||||
Server ID: ${response.guild_id}
|
||||
${sourceGuildGet}
|
||||
${sourceChannelGet}
|
||||
|
||||
Creator UserID: ${response.user.id}`
|
||||
}]
|
||||
|
@ -173,6 +167,7 @@ export default definePlugin({
|
|||
avatar_url: "",
|
||||
tts: findOption(option, "tts")
|
||||
});
|
||||
|
||||
}
|
||||
sendBotMessage(ctx.channel.id, {
|
||||
content: "Message sent successfully."
|
||||
|
|
Loading…
Reference in a new issue