diff --git a/commands/Administration/goodbye.js b/commands/Administration/goodbye.js index ab6c4e0d..cfc37923 100644 --- a/commands/Administration/goodbye.js +++ b/commands/Administration/goodbye.js @@ -61,16 +61,16 @@ class Goodbye extends BaseCommand { uk: client.translate("administration/goodbye:MESSAGE", null, "uk-UA"), ru: client.translate("administration/goodbye:MESSAGE", null, "ru-RU"), }), - ) - .addBooleanOption(option => - option - .setName("image") - .setDescription(client.translate("administration/goodbye:IMAGE")) - .setDescriptionLocalizations({ - uk: client.translate("administration/goodbye:IMAGE", null, "uk-UA"), - ru: client.translate("administration/goodbye:IMAGE", null, "ru-RU"), - }), ), + // .addBooleanOption(option => + // option + // .setName("image") + // .setDescription(client.translate("administration/goodbye:IMAGE")) + // .setDescriptionLocalizations({ + // uk: client.translate("administration/goodbye:IMAGE", null, "uk-UA"), + // ru: client.translate("administration/goodbye:IMAGE", null, "ru-RU"), + // }), + // ), ), dirname: __dirname, ownerOnly: false, @@ -103,13 +103,14 @@ class Goodbye extends BaseCommand { withImage: null, }; + await guildData.markModified("plugins.goodbye"); await guildData.save(); interaction.success("administration/goodbye:DISABLED", null, { edit: true }); } else { const channel = interaction.options.getChannel("channel") || interaction.channel; const message = interaction.options.getString("message") || interaction.translate("administration/goodbye:DEFAULT_MESSAGE"); - const image = interaction.options.getBoolean("image") || false; + const image = false; // interaction.options.getBoolean("image") || false; guildData.plugins.goodbye = { enabled: true, @@ -118,6 +119,7 @@ class Goodbye extends BaseCommand { withImage: image, }; + await guildData.markModified("plugins.goodbye"); await guildData.save(); interaction.success("administration/goodbye:ENABLED", { diff --git a/commands/Administration/welcome.js b/commands/Administration/welcome.js index 130d2ccb..56af2554 100644 --- a/commands/Administration/welcome.js +++ b/commands/Administration/welcome.js @@ -61,16 +61,16 @@ class Welcome extends BaseCommand { uk: client.translate("administration/goodbye:MESSAGE", null, "uk-UA"), ru: client.translate("administration/goodbye:MESSAGE", null, "ru-RU"), }), - ) - .addBooleanOption(option => - option - .setName("image") - .setDescription(client.translate("administration/goodbye:IMAGE")) - .setDescriptionLocalizations({ - uk: client.translate("administration/goodbye:IMAGE", null, "uk-UA"), - ru: client.translate("administration/goodbye:IMAGE", null, "ru-RU"), - }), ), + // .addBooleanOption(option => + // option + // .setName("image") + // .setDescription(client.translate("administration/goodbye:IMAGE")) + // .setDescriptionLocalizations({ + // uk: client.translate("administration/goodbye:IMAGE", null, "uk-UA"), + // ru: client.translate("administration/goodbye:IMAGE", null, "ru-RU"), + // }), + // ), ), dirname: __dirname, ownerOnly: false, @@ -103,13 +103,14 @@ class Welcome extends BaseCommand { withImage: null, }; + await guildData.markModified("plugins.welcome"); await guildData.save(); interaction.success("administration/welcome:DISABLED", null); } else { const channel = interaction.options.getChannel("channel") || interaction.channel; const message = interaction.options.getString("message") || interaction.translate("administration/welcome:DEFAULT_MESSAGE"); - const image = interaction.options.getBoolean("image") || false; + const image = false; // interaction.options.getBoolean("image") || false; guildData.plugins.welcome = { enabled: true, @@ -118,6 +119,7 @@ class Welcome extends BaseCommand { withImage: image, }; + await guildData.markModified("plugins.welcome"); await guildData.save(); interaction.success("administration/welcome:ENABLED", { diff --git a/events/Guild/guildMemberAdd.js b/events/Guild/guildMemberAdd.js index a94c586a..8e9f40c3 100644 --- a/events/Guild/guildMemberAdd.js +++ b/events/Guild/guildMemberAdd.js @@ -1,7 +1,9 @@ -const Canvas = require("@napi-rs/canvas"), - BaseEvent = require("../../base/BaseEvent"), - { AttachmentBuilder } = require("discord.js"), - { applyText } = require("../../helpers/functions"); +// const Canvas = require("@napi-rs/canvas"), +// BaseEvent = require("../../base/BaseEvent"), +// { AttachmentBuilder } = require("discord.js"), +// { applyText } = require("../../helpers/functions"); + +const BaseEvent = require("../../base/BaseEvent"); class GuildMemberAdd extends BaseEvent { constructor() { @@ -34,6 +36,7 @@ class GuildMemberAdd extends BaseEvent { .replace(/{server}/g, member.guild.name) .replace(/{membercount}/g, member.guild.memberCount); + /* if (guildData.plugins.welcome.withImage) { const canvas = Canvas.createCanvas(1024, 450), ctx = canvas.getContext("2d"); @@ -127,8 +130,9 @@ class GuildMemberAdd extends BaseEvent { content: message, files: [attachment], }); - } else - channel.send({ content: message }); + } else */ + + channel.send({ content: message }); } } } diff --git a/events/Guild/guildMemberRemove.js b/events/Guild/guildMemberRemove.js index 6741f816..318f8bd2 100644 --- a/events/Guild/guildMemberRemove.js +++ b/events/Guild/guildMemberRemove.js @@ -1,7 +1,9 @@ -const Canvas = require("@napi-rs/canvas"), - BaseEvent = require("../../base/BaseEvent"), - { AttachmentBuilder } = require("discord.js"), - { applyText } = require("../../helpers/functions"); +// const Canvas = require("@napi-rs/canvas"), +// BaseEvent = require("../../base/BaseEvent"), +// { AttachmentBuilder } = require("discord.js"), +// { applyText } = require("../../helpers/functions"); + +const BaseEvent = require("../../base/BaseEvent"); class GuildMemberRemove extends BaseEvent { constructor() { @@ -32,6 +34,7 @@ class GuildMemberRemove extends BaseEvent { .replace(/{server}/g, member.guild.name) .replace(/{membercount}/g, member.guild.memberCount); + /* if (guildData.plugins.goodbye.withImage) { const canvas = Canvas.createCanvas(1024, 450), ctx = canvas.getContext("2d"); @@ -130,8 +133,9 @@ class GuildMemberRemove extends BaseEvent { content: message, files: [attachment], }); - } else - channel.send({ content: message }); + } else */ + + channel.send({ content: message }); } } } diff --git a/helpers/functions.js b/helpers/functions.js index eed315ec..c0f9b047 100644 --- a/helpers/functions.js +++ b/helpers/functions.js @@ -1,9 +1,9 @@ -const moment = require("moment"), - { GlobalFonts } = require("@napi-rs/canvas"), - { resolve } = require("path"); +const moment = require("moment"); +// const { GlobalFonts } = require("@napi-rs/canvas"), +// const { resolve } = require("path"); -GlobalFonts.registerFromPath(resolve("./assets/fonts/RubikMonoOne-Regular.ttf"), "RubikMonoOne"); -GlobalFonts.registerFromPath(resolve("./assets/fonts/KeepCalm-Medium.ttf"), "KeepCalm"); +// GlobalFonts.registerFromPath(resolve("./assets/fonts/RubikMonoOne-Regular.ttf"), "RubikMonoOne"); +// GlobalFonts.registerFromPath(resolve("./assets/fonts/KeepCalm-Medium.ttf"), "KeepCalm"); module.exports = { /**