Skip to content
Snippets Groups Projects
Commit 1316d8d8 authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

ajout d'une vérification supplémentaire pour le webhook de dev

parent 76b39e26
No related branches found
No related tags found
No related merge requests found
......@@ -593,11 +593,16 @@ async function checkAnniv() {
async function verifyMcChatWebhook() {
let mcChatWebhookId = await botSettings.findOne({ where: { name: "mcChatWebhookId" } });
if (mcChatWebhookId != null) {
let devMcChatWebhookId = await botSettings.findOne({ where: { name: "devMcChatWebhookId" } });
if (mcChatWebhookId != null && devMcChatWebhookId != null) {
console.log("[" + 'INFO'.yellow + "] Le Webhook du serveur MC est déjà configuré.");
let mcChatWebhookToken = await botSettings.findOne({ where: { name: "mcChatWebhookToken" } });
if (mcChatWebhookToken) {
let devMcChatWebhookToken = await botSettings.findOne({ where: { name: "devMcChatWebhookToken" } });
if (mcChatWebhookToken != null && devMcChatWebhookToken != null) {
mcChatWebhook = new WebhookClient({ id: mcChatWebhookId.value, token: mcChatWebhookToken.value });
devMcChatWebhook = new WebhookClient({ id: devMcChatWebhookId.value, token: devMcChatWebhookToken.value });
} else {
console.log("[" + 'ERREUR'.brightRed + "] Impossible de trouver le token du webhook dans la base de donnée.");
createMcChatWebhook();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment