From 118954f7954a74f80bba5993d55fabf21833f753 Mon Sep 17 00:00:00 2001 From: Supositware Date: Mon, 10 Oct 2022 19:07:53 +0200 Subject: [PATCH] Fix join/leave message --- utils/rand.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/rand.js b/utils/rand.js index 08974e51..9e31ec11 100644 --- a/utils/rand.js +++ b/utils/rand.js @@ -1,6 +1,8 @@ import fs from 'node:fs'; export function rand(text, interaction) { - interaction.author = interaction.user; + if (interaction) { + interaction.author = interaction.user; + } // Find a value in an array of objects in Javascript - https://stackoverflow.com/a/12462387 function search(nameKey, myArray) { for (let i = 0; i < myArray.length; i++) {