Add missing semicolons and change indentation

This commit is contained in:
Ninjdai1 2023-09-30 08:29:50 +02:00
parent 2ce4a5b10c
commit 6fe05437bb
19 changed files with 197 additions and 215 deletions

View File

@ -14,8 +14,8 @@ export default {
case 'sanctions':
await interaction.reply({ components: [sanctionembedrow], ephemeral: true });
break;
}
}
};
},
};

View File

@ -13,68 +13,64 @@ export default {
.setName('graphisme')
.setDescription('Diverse commandes pour le graphisme.')
.addSubcommand(
subcommand =>
subcommand
.setName('inspiration')
.setDescription('Une citation, suggestion de couleur ou proposition de méthode.')
subcommand => subcommand
.setName('inspiration')
.setDescription('Une citation, suggestion de couleur ou proposition de méthode.')
)
.addSubcommand(
subcommand =>
subcommand
.setName('palette')
.setDescription('Une palette harmonieuse générée aléatoirement.')
subcommand => subcommand
.setName('palette')
.setDescription('Une palette harmonieuse générée aléatoirement.')
)
.addSubcommand(
subcommand =>
subcommand
.setName('remix')
.setDescription('Renvoie l\'image insérée avec un filtre appliqué.')
.addAttachmentOption(option => option
.setName('image')
.setDescription('Image à modifier')
.setRequired(true))
.addStringOption(option =>
option.setName('filter')
.setDescription('Le filtre appliqué')
.setRequired(true)
.addChoices(
{ name: 'Invert', value: 'invert' },
{ name: 'Nuance de gris', value: 'grayscale' },
{ name: 'Sepia', value: 'sepia' },
{ name: 'Flou', value: 'blur' },
{ name: 'Pixelisé', value: 'pixelate' },
{ name: 'Miroir', value: 'mirror' },
{ name: 'Rotation', value: 'rotate' },
{ name: 'Luminosité', value: 'brightness' },
{ name: 'Vintage', value: 'vintage' },
{ name: 'Peinture à l\'huile', value: 'oilpaint' },
{ name: 'Aquarelle', value: 'watercolor' },
{ name: 'Néon', value: 'neon' },
))
subcommand => subcommand
.setName('remix')
.setDescription('Renvoie l\'image insérée avec un filtre appliqué.')
.addAttachmentOption(option => option
.setName('image')
.setDescription('Image à modifier')
.setRequired(true))
.addStringOption(option => option
.setName('filter')
.setDescription('Le filtre appliqué')
.setRequired(true)
.addChoices(
{ name: 'Invert', value: 'invert' },
{ name: 'Nuance de gris', value: 'grayscale' },
{ name: 'Sepia', value: 'sepia' },
{ name: 'Flou', value: 'blur' },
{ name: 'Pixelisé', value: 'pixelate' },
{ name: 'Miroir', value: 'mirror' },
{ name: 'Rotation', value: 'rotate' },
{ name: 'Luminosité', value: 'brightness' },
{ name: 'Vintage', value: 'vintage' },
{ name: 'Peinture à l\'huile', value: 'oilpaint' },
{ name: 'Aquarelle', value: 'watercolor' },
{ name: 'Néon', value: 'neon' },
))
)
.addSubcommand(
subcommand =>
subcommand
.setName('blend')
.setDescription('Combine deux couleurs pour en créer une troisième.')
.addStringOption(option =>
option.setName('color1')
.setDescription('La première couleur')
.setRequired(true))
.addStringOption(option =>
option.setName('color2')
.setDescription('La deuxième couleur')
.setRequired(true))
.addStringOption(option =>
option.setName('mode')
.setDescription('Le mode de fusion')
.setRequired(true)
.addChoices(
{ name: 'Normal', value: 'normal' },
{ name: 'Multiplication', value: 'multiply' },
{ name: 'Écran', value: 'screen' },
{ name: 'Overlay', value: 'overlay' },
))
subcommand => subcommand
.setName('blend')
.setDescription('Combine deux couleurs pour en créer une troisième.')
.addStringOption(option => option
.setName('color1')
.setDescription('La première couleur')
.setRequired(true))
.addStringOption(option => option
.setName('color2')
.setDescription('La deuxième couleur')
.setRequired(true))
.addStringOption(option => option
.setName('mode')
.setDescription('Le mode de fusion')
.setRequired(true)
.addChoices(
{ name: 'Normal', value: 'normal' },
{ name: 'Multiplication', value: 'multiply' },
{ name: 'Écran', value: 'screen' },
{ name: 'Overlay', value: 'overlay' },
))
),
async execute(interaction) {
switch (interaction.options.getSubcommand()) {
@ -90,6 +86,6 @@ export default {
case 'blend':
Blend.execute(interaction);
break;
}
}
};
},
};

View File

@ -128,7 +128,7 @@ export default {
value: `**Ouverts** : ${openticketqty}\n**Pris en charge** : ${takenticketsqty}`,
inline: true
}
)
);
await interaction.reply({
embeds:[embedSERVINFO],
ephemeral: false
@ -206,11 +206,11 @@ export default {
value: `\`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}\` MB`,
inline: true,
},
])
]);
await interaction.reply({
embeds: [embedBOTINFO],
ephemeral: false
})
});
break;
}
}

View File

@ -1,11 +1,11 @@
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
export default {
data: new SlashCommandBuilder()
.setName('lovecalc')
.setDescription('Pour calculer le pourcentage d\'amour avec April !')
.addUserOption(option => option.setName('utilisateur')
.setDescription('Utilisateur avec qui tester le lovecalc')
.setRequired(false)),
.setName('lovecalc')
.setDescription('Pour calculer le pourcentage d\'amour avec April !')
.addUserOption(option => option.setName('utilisateur')
.setDescription('Utilisateur avec qui tester le lovecalc')
.setRequired(false)),
async execute(interaction) {
try {
let user = interaction.options.getUser('utilisateur');
@ -36,7 +36,7 @@ export default {
if(love>100) love = 100
textlove = `${love}% ! T'as l'air vachement sympa ${user.username} !`;
image = "https://media.discordapp.net/attachments/867491241491038209/970423543626092604/portalgirl-wouah.webp";
}
};
var loveEmbed = new EmbedBuilder()
.setColor('#ff00d0')
@ -45,8 +45,8 @@ export default {
.setTimestamp();
await interaction.reply({ embeds: [loveEmbed] });
} catch (error) {
console.error(error)
}
console.error(error);
};
},
};
@ -55,4 +55,4 @@ const loverates = {
"277136155244232706": ["Dawn ? HMMMMMMMMMMMM", "https://media.discordapp.net/attachments/867491241491038209/1036987746809548860/AprilThinking.png"],//Ced
"718456289704804392": ["MAMAN JTM <333", "https://media.discordapp.net/attachments/867491241491038209/1036987744670457907/april_cat.png"],
"397867150867693579": ["Il a des bons gouts musicaux lui", "https://cdn.discordapp.com/attachments/867491241491038209/1036988529248567306/AprilMusic.png"]
}
};

View File

@ -30,6 +30,6 @@ export default {
emoji: emoji,
});
await interaction.reply({ content: `Émoji de <@${member.id}> défini sur ${emoji} !`, ephemeral: true });
}
};
},
};

View File

@ -27,6 +27,6 @@ export default {
.setColor('#fc00f8')
.setDescription('Suite Description, Suite placeholder, Suite tuto hahahaha'),
]
})
}
}
});
},
};

View File

@ -4,7 +4,7 @@ export default {
.setName('UserInfo')
.setType(2),
async execute(interaction, client) {
async execute(interaction) {
const user = interaction.targetUser;
const member = interaction.targetMember;
@ -45,15 +45,15 @@ export default {
name: `📝 Rôles [${member.roles.cache.size - 1}]`,
value: member.roles.cache.size ? member.roles.cache.map(roles => `**${roles}**`).slice(0, 20).join(" ") : "None",
inline: false
}])
}
}]);
};
} else {
embedUSERINFO.setDescription("Utilisateur inconnu")
}
};
await interaction.reply({
embeds: [embedUSERINFO],
ephemeral: false
});
}
}
},
};

View File

@ -13,7 +13,7 @@ export default {
.setName('user')
.setDescription('Membre à bannir / id si le membre n\'est pas sur le serveur')
.setRequired(true)
)
)
.addStringOption(
option =>
option
@ -60,19 +60,18 @@ export default {
inline: true
},
);
await interaction.reply({embeds: [banEMBED], ephemeral: true});
const channel = await interaction.guild.channels.cache.get(sanctionChannelId);
await channel.send({
embeds: [banEMBED]
});
await client.database.modlog.create({
name: user.id,
username: user.tag,
type: "Ban",
reason: reason,
timestamp: Math.floor(new Date().getTime()/1000),
moderatorid: interaction.member.user.id
})
}
await interaction.reply({embeds: [banEMBED], ephemeral: true});
const channel = await interaction.guild.channels.cache.get(sanctionChannelId);
await channel.send({
embeds: [banEMBED]
});
await client.database.modlog.create({
name: user.id,
username: user.tag,
type: "Ban",
reason: reason,
timestamp: Math.floor(new Date().getTime()/1000),
moderatorid: interaction.member.user.id
});
},
};

View File

@ -36,8 +36,7 @@ export default {
.setMinLength(10)
.setMaxLength(1000)
),
])
interaction.showModal(banModal)
}
]);
interaction.showModal(banModal);
},
};

View File

@ -14,7 +14,7 @@ export default {
.setRequired(true)
)
.setDescription('Supprimer un grand nombre de messages d\'un salon'),
async execute(interaction, client) {
async execute(interaction) {
await interaction.deferReply({ ephemeral: true })
const number = interaction.options.getInteger('nombre');
try {
@ -25,6 +25,6 @@ export default {
await interaction.editReply({ content: `J'ai bien supprimé ${notPinned.size} message${notPinned.size>1 ? "s" : ""} dans ce salon`, ephemeral: true});
} catch(err) {
console.error(err);
}
}
};
},
};

View File

@ -73,6 +73,6 @@ export default {
reason: reason,
timestamp: Math.floor(new Date().getTime()/1000),
moderatorid: interaction.member.user.id
})
}
});
},
};

View File

@ -79,6 +79,6 @@ export default {
reason: reason,
timestamp: Math.floor(new Date().getTime()/1000),
moderatorid: interaction.member.user.id
})
});
}
};

View File

@ -30,7 +30,7 @@ export default {
const memberRoleRawPos = interaction.member.roles.highest.rawPosition;
if (user.id === interaction.user.id) return interaction.reply({content: `Vous ne pouvez pas vous noter vous-même! !`, ephemeral: true});
if (userRoleRawPos >= memberRoleRawPos) return interaction.reply({content: `Vous ne pouvez pas noter cet utilisateur.`, ephemeral: true});
}
};
const banEMBED = new EmbedBuilder()
.setColor(`#009500`)
@ -57,19 +57,18 @@ export default {
inline: true
},
);
await interaction.reply({embeds: [banEMBED], ephemeral: true});
const channel = await interaction.guild.channels.cache.get(sanctionChannelId);
await channel.send({
embeds: [banEMBED]
});
await client.database.modlog.create({
name: user.id,
username: user.tag,
type: "Note",
reason: reason,
timestamp: Math.floor(new Date().getTime()/1000),
moderatorid: interaction.member.user.id
})
}
await interaction.reply({embeds: [banEMBED], ephemeral: true});
const channel = await interaction.guild.channels.cache.get(sanctionChannelId);
await channel.send({
embeds: [banEMBED]
});
await client.database.modlog.create({
name: user.id,
username: user.tag,
type: "Note",
reason: reason,
timestamp: Math.floor(new Date().getTime()/1000),
moderatorid: interaction.member.user.id
});
},
};

View File

@ -15,8 +15,8 @@ export default {
case 'create':
await interaction.reply({ embeds: [baseembed], components: embedbuilderrows, ephemeral: true });
break;
}
}
};
},
};
const baseembed = new EmbedBuilder()
.setTitle("Constructeur d'embed")

View File

@ -7,10 +7,8 @@ export default {
.setDefaultMemberPermissions(0x8),
async execute(interaction){
const embed = interaction.targetMessage.embeds[0] || baseembed;
await interaction.reply({ embeds: [embed], components: embedbuilderrows, ephemeral: true });
}
},
}
const baseembed = new EmbedBuilder()

View File

@ -12,73 +12,64 @@ export default {
.setDescription('Effectuer une mise en place.')
.setDefaultMemberPermissions(0x8)
.addSubcommand(
subcommand =>
subcommand
.setName('tickets')
.setDescription('Mise en place des tickets.')
.addStringOption(option =>
option
.setName('type')
.setDescription('Le type de tickets à mettre en place.')
.setRequired(true)
.setChoices(
{name: 'Commandes', value: 'commands'},
{name: 'Support', value: 'support'},
)
subcommand => subcommand
.setName('tickets')
.setDescription('Mise en place des tickets.')
.addStringOption(option => option
.setName('type')
.setDescription('Le type de tickets à mettre en place.')
.setRequired(true)
.setChoices(
{name: 'Commandes', value: 'commands'},
{name: 'Support', value: 'support'},
)
.addChannelOption(option =>
option
.setName('channel')
.setDescription('Choisissez le salon où l\'embed sera envoyé !')
.addChannelTypes(ChannelType.GuildText)
.setRequired(true))
)
.addChannelOption(option => option
.setName('channel')
.setDescription('Choisissez le salon où l\'embed sera envoyé !')
.addChannelTypes(ChannelType.GuildText)
.setRequired(true))
)
.addSubcommand(
subcommand =>
subcommand
.setName('panel')
.setDescription('Mise en place des panels.')
.addStringOption(option =>
option
.setName('type')
.setDescription('Le type de panel à mettre en place.')
.setRequired(true)
.setChoices(
{name: 'Rolereact', value: 'rolereact'},
{name: 'Embed du rolereact', value: 'rolereactembed'},
{name: 'Candidatures', value: 'candidatures'},
{name: 'Embed des sanctions', value: 'sanctionembed'},
{name: 'Album Photo', value: 'albumphoto'}
)
subcommand => subcommand
.setName('panel')
.setDescription('Mise en place des panels.')
.addStringOption(option => option
.setName('type')
.setDescription('Le type de panel à mettre en place.')
.setRequired(true)
.setChoices(
{name: 'Rolereact', value: 'rolereact'},
{name: 'Embed du rolereact', value: 'rolereactembed'},
{name: 'Candidatures', value: 'candidatures'},
{name: 'Embed des sanctions', value: 'sanctionembed'},
{name: 'Album Photo', value: 'albumphoto'}
)
.addChannelOption(option =>
option
.setName('channel')
.setDescription('Choisissez le salon où le panel sera envoyé !')
.addChannelTypes(ChannelType.GuildText)
.setRequired(true))
)
.addChannelOption(option => option
.setName('channel')
.setDescription('Choisissez le salon où le panel sera envoyé !')
.addChannelTypes(ChannelType.GuildText)
.setRequired(true))
)
.addSubcommand(
subcommand =>
subcommand
.setName('moderation')
.setDescription('Mise en place de la modération.')
.addStringOption(option =>
option
.setName('type')
.setDescription('Le type de panel de modération à mettre en place.')
.setRequired(true)
.setChoices(
{name: 'Sanctions', value: 'sanctions'},
{name: 'Blacklist', value: 'blacklist'},
)
subcommand => subcommand
.setName('moderation')
.setDescription('Mise en place de la modération.')
.addStringOption(option => option
.setName('type')
.setDescription('Le type de panel de modération à mettre en place.')
.setRequired(true)
.setChoices(
{name: 'Sanctions', value: 'sanctions'},
{name: 'Blacklist', value: 'blacklist'},
)
.addChannelOption(option =>
option
.setName('channel')
.setDescription('Choisissez le salon où le panel sera envoyé !')
.addChannelTypes(ChannelType.GuildText)
.setRequired(true))
)
.addChannelOption(option => option
.setName('channel')
.setDescription('Choisissez le salon où le panel sera envoyé !')
.addChannelTypes(ChannelType.GuildText)
.setRequired(true))
),
async execute(interaction) {
switch (interaction.options.getSubcommand()) {
@ -91,6 +82,6 @@ export default {
case 'moderation':
SetupMod.execute(interaction);
break;
}
}
};
},
};

View File

@ -24,31 +24,31 @@ export default {
.setRequired(true)
)
),
async execute(interaction, client) {
async execute(interaction) {
await interaction.deferReply({ ephemeral: true })
const channel = interaction.options.getChannel('channel');
const message = await channel.messages.fetch(interaction.options.getString('messageid'))
if (!message) return interaction.reply({ content: "Je n'ai pas trouvé le message correspondant, vérifiez votre id", ephemeral: true })
const message = await channel.messages.fetch(interaction.options.getString('messageid'));
if (!message) return interaction.reply({ content: "Je n'ai pas trouvé le message correspondant, vérifiez votre id", ephemeral: true });
const a = new ButtonBuilder(message.components[0].components[0].data)
const a = new ButtonBuilder(message.components[0].components[0].data);
const b = new ButtonBuilder(message.components[0].components[1].data)
.setDisabled(!message.components[0].components[1].data.disabled)
.setDisabled(!message.components[0].components[1].data.disabled);
const embed = new EmbedBuilder(message.embeds[0].data)
const embed = new EmbedBuilder(message.embeds[0].data);
if (message.components[0].components[1].data.disabled) {
embed.setDescription(description[0])
} else {
embed.setDescription(description[1])
}
embed.setDescription(description[0]);
} else {
embed.setDescription(description[1]);
};
const msg = message.components[0].components[1].data.disabled ? "Commandes bénévoles activées !" : "Commandes bénévoles désactivées !"
const msg = message.components[0].components[1].data.disabled ? "Commandes bénévoles activées !" : "Commandes bénévoles désactivées !";
await message.edit({ components: [ new ActionRowBuilder().addComponents([a,b]) ], embeds: [embed] })
await interaction.editReply({ ephemeral: true, content: msg })
}
await message.edit({ components: [ new ActionRowBuilder().addComponents([a,b]) ], embeds: [embed] });
await interaction.editReply({ ephemeral: true, content: msg });
},
};
const description = [
"Tu veux passer commande ? Choisis ci-dessous en fonction de ton budget ! ^^",
"Tu veux passer commande ? Choisis ci-dessous en fonction de ton budget ! ^^\n\n**Les tickets bénévoles sont actuellement désactivés pour cause de surcharge !** Dès que la plupart seront écoulés, les commandes bénévoles rouvriront !\n\n*Vous pouvez regarder le nombre de commandes en cours via le </info server:947504536417878046> !*",
]
];

View File

@ -20,10 +20,10 @@ async function deploy_commands(client, loadcommands) {
const commands = [];
client.commands = new Collection();
const commandCategories = fs.readdirSync('./commands').filter(file => !file.includes('.'));
console.log(`Loading ${commandCategories.toString()} commands...`)
console.log(`Loading ${commandCategories.toString()} commands...`);
for (const category of commandCategories) {
const commandFiles = fs.readdirSync(`./commands/${category}`).filter(file => file.endsWith('.mjs'));
console.log(`Loading ${commandFiles.toString()}...`)
console.log(`Loading ${commandFiles.toString()}...`);
for (const file of commandFiles) {
const { default: command } = await import(`./commands/${category}/${file}`);
commands.push(command.data);
@ -62,7 +62,7 @@ async function slashCommandLoad(client, commands) {
function loadDatabase(client) {
console.log("Starting to load database...")
console.log("Starting to load database...");
const sequelize = new Sequelize('database', sequelizeCredentials.username, sequelizeCredentials.password, {
host: 'localhost',
dialect: 'sqlite',
@ -103,11 +103,11 @@ function loadDatabase(client) {
blacklistdb.sync();
modlog.sync();
artists.sync();
console.log("Database loaded !")
console.log("Database loaded !");
}
function loadErrorCatcher(client) {
console.log("Loading error catcher...")
console.log("Loading error catcher...");
client.errorCatcherWebhook = new WebhookClient({
url: errorWebhookURL,
});
@ -129,7 +129,7 @@ function loadErrorCatcher(client) {
value: `\`\`\`${inspect(promise, { depth: 0 }).slice(0, 1000)}\`\`\``,
}
)
.setTimestamp();
.setTimestamp();
return client.errorCatcherWebhook.send({ embeds: [errorEmbed] });
});
@ -151,7 +151,7 @@ function loadErrorCatcher(client) {
value: `\`\`\`${inspect(origin, { depth: 0 }).slice(0, 1000)}\`\`\``,
}
)
.setTimestamp();
.setTimestamp();
return client.errorCatcherWebhook.send({ embeds: [errorEmbed] });
});
@ -196,7 +196,7 @@ function loadErrorCatcher(client) {
return client.errorCatcherWebhook.send({ embeds: [errorEmbed] });
});
console.log("Error catcher loaded !")
console.log("Error catcher loaded !");
}
export { deploy_commands, loadDatabase, loadErrorCatcher }

View File

@ -27,7 +27,7 @@ for (const file of eventFiles) {
} else {
client.on(event.name, (...args) => event.execute(...args, client));
}
console.log(`Loaded ${event.name} event !`)
console.log(`Loaded ${event.name} event !`);
}
deploy_commands(client, true);