From b89b926f9a327100027ceb7c069b549c78be9f37 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Tue, 5 Nov 2024 06:13:21 +0100 Subject: [PATCH] Update actions/checkout to v4 --- .github/workflows/njsscan.yml | 2 +- commands/info/help.js | 3 --- commands/misc/emoji.js | 3 ++- server/ready.js | 3 ++- util/lastfm/getCurrentCover.js | 1 + util/lastfm/getCurrentScrobble.js | 1 + util/reloadCommands.js | 1 - util/timer/checkTimer.js | 1 - util/timer/convertJSONToSQL.js | 1 - util/timer/createTimer.js | 1 - util/timer/parseTime.js | 6 +++--- 11 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/njsscan.yml b/.github/workflows/njsscan.yml index ff888b4..45de787 100644 --- a/.github/workflows/njsscan.yml +++ b/.github/workflows/njsscan.yml @@ -30,7 +30,7 @@ jobs: name: njsscan code scanning steps: - name: Checkout the code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: nodejsscan scan id: njsscan uses: ajinabraham/njsscan-action@v7 diff --git a/commands/info/help.js b/commands/info/help.js index 6174e26..e88df47 100644 --- a/commands/info/help.js +++ b/commands/info/help.js @@ -1,4 +1,3 @@ -const fs = require('fs'); const {EmbedBuilder} = require('discord.js'); const getSubdirFiles = require('../../util/getSubdirFiles'); @@ -17,7 +16,6 @@ module.exports = { let fieldName = `Page [[page]]/${Math.round(client.commands.size / 10)}`; let iteration = 0; let num_in_args = false; - let added_commands = 0; let page = -1; @@ -53,7 +51,6 @@ module.exports = { if (!command.admin){ if(start < iteration){ }else{ - added_commands++ commands = commands + `${prefix}${command.name} | ${command.description}\n`; iteration++ } diff --git a/commands/misc/emoji.js b/commands/misc/emoji.js index 6ce12dc..58befa8 100644 --- a/commands/misc/emoji.js +++ b/commands/misc/emoji.js @@ -19,7 +19,8 @@ module.exports = { try { num = num.slice(0, -1); } catch (e) { - message.channel.send("There was an error."); + console.error(e) + message.channel.send("There was an error. Check the logs"); return; } message.channel.send("https://cdn.discordapp.com/emojis/" + num + extension); diff --git a/server/ready.js b/server/ready.js index 20324b7..b65e8ff 100644 --- a/server/ready.js +++ b/server/ready.js @@ -9,7 +9,8 @@ module.exports = function(client, enableLoginMessage, loginChannel, loginMessage try{ client.channels.cache.get(loginChannel).send(loginMessage) }catch(err){ - console.log("Failed trying to send a message on login.\n") + console.error("Failed trying to send a message on login.\n") + console.error(err) } loadServerPrefixes(client) checkTimer(client); diff --git a/util/lastfm/getCurrentCover.js b/util/lastfm/getCurrentCover.js index bc4224c..16a1b98 100644 --- a/util/lastfm/getCurrentCover.js +++ b/util/lastfm/getCurrentCover.js @@ -25,6 +25,7 @@ module.exports = async function(userID, guild) { try { track = data.recenttracks.track[0]; } catch (error) { + console.error(error); scrobble.error = true; switch(data.error){ case 6: diff --git a/util/lastfm/getCurrentScrobble.js b/util/lastfm/getCurrentScrobble.js index d1071ff..5c83bd5 100644 --- a/util/lastfm/getCurrentScrobble.js +++ b/util/lastfm/getCurrentScrobble.js @@ -39,6 +39,7 @@ module.exports = async function (userID, guild) { } resolve(tracks); } catch (error) { + console.error(error) let scrobble = {}; scrobble.error = true; if (data.error === 6) { diff --git a/util/reloadCommands.js b/util/reloadCommands.js index 025632e..6faad91 100644 --- a/util/reloadCommands.js +++ b/util/reloadCommands.js @@ -1,4 +1,3 @@ -const fs = require('fs'); const getSubdirFiles = require('./getSubdirFiles'); const commandPath = 'commands/' const utilPath = 'util/' diff --git a/util/timer/checkTimer.js b/util/timer/checkTimer.js index 1bea13b..8902f5c 100644 --- a/util/timer/checkTimer.js +++ b/util/timer/checkTimer.js @@ -1,5 +1,4 @@ const sendTimerReminder = require('./sendTimerReminder') -const fs = require('fs') const sqlite3 = require('sqlite3').verbose(); module.exports = async function (client) { const checkTimer = require('./checkTimer') diff --git a/util/timer/convertJSONToSQL.js b/util/timer/convertJSONToSQL.js index efa1bed..ad3d2d5 100644 --- a/util/timer/convertJSONToSQL.js +++ b/util/timer/convertJSONToSQL.js @@ -1,4 +1,3 @@ -const fs = require('fs'); const sqlite3 = require('sqlite3').verbose(); module.exports = async function () { const timers = require('../../data/timers.json') diff --git a/util/timer/createTimer.js b/util/timer/createTimer.js index 3910d09..4ff2fb4 100644 --- a/util/timer/createTimer.js +++ b/util/timer/createTimer.js @@ -1,4 +1,3 @@ -const fs = require('fs'); const parseTime = require('./parseTime'); const sqlite3 = require('sqlite3').verbose(); module.exports = async function (message, args, compatibility) { diff --git a/util/timer/parseTime.js b/util/timer/parseTime.js index 732fe80..e20dd99 100644 --- a/util/timer/parseTime.js +++ b/util/timer/parseTime.js @@ -30,9 +30,9 @@ module.exports = function(time, currentUnixTime){ -function getTime(time, currentUnixTime) { +// function getTime(time, currentUnixTime) { - return timeInSeconds; -} +// return timeInSeconds; +// }