mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
fix: update logger for all util
This commit is contained in:
1 parent
57fc1e3ee8
commit
7cb25c5648
10 files changed
+20
-15
No files matched your search
@@ -15,7 +15,7 @@ module.exports = {
|
|||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setNSFW(false),
|
.setNSFW(false),
|
||||||
execute: async ({ interaction, client, executionId }) => {
|
execute: async ({ interaction, client, executionId }) => {
|
||||||
const uptimeString = await getUptimeFormatted();
|
const uptimeString = await getUptimeFormatted({ executionId });
|
||||||
const usedMemoryInMB = Math.ceil((await osu.mem.info()).usedMemMb).toLocaleString('en-US');
|
const usedMemoryInMB = Math.ceil((await osu.mem.info()).usedMemMb).toLocaleString('en-US');
|
||||||
const cpuUsage = await osu.cpu.usage();
|
const cpuUsage = await osu.cpu.usage();
|
||||||
const releaseVersion = version;
|
const releaseVersion = version;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// from normal /status command
|
// from normal /status command
|
||||||
const uptimeString = await getUptimeFormatted();
|
const uptimeString = await getUptimeFormatted({ executionId });
|
||||||
const usedMemoryInMB = Math.ceil((await osu.mem.info()).usedMemMb).toLocaleString('en-US');
|
const usedMemoryInMB = Math.ceil((await osu.mem.info()).usedMemMb).toLocaleString('en-US');
|
||||||
const cpuUsage = await osu.cpu.usage();
|
const cpuUsage = await osu.cpu.usage();
|
||||||
const releaseVersion = version;
|
const releaseVersion = version;
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ const Discord = require('discord.js');
|
|||||||
|
|
||||||
exports.createClient = async ({ executionId }) => {
|
exports.createClient = async ({ executionId }) => {
|
||||||
const logger = require('../../services/logger').child({
|
const logger = require('../../services/logger').child({
|
||||||
source: 'createPlayer.js',
|
source: 'createClient.js',
|
||||||
module: 'utilFactory',
|
module: 'utilFactory',
|
||||||
name: 'createPlayer',
|
name: 'createClient',
|
||||||
executionId: executionId,
|
executionId: executionId,
|
||||||
shardId: 'client'
|
shardId: 'client'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ exports.startLoadTest = async ({ client, executionId }) => {
|
|||||||
const logger = require('../../services/logger').child({
|
const logger = require('../../services/logger').child({
|
||||||
source: 'startLoadTest.js',
|
source: 'startLoadTest.js',
|
||||||
module: 'utilOther',
|
module: 'utilOther',
|
||||||
name: 'loadTest',
|
name: 'startLoadTest',
|
||||||
executionId: executionId,
|
executionId: executionId,
|
||||||
shardId: client.shard.ids[0]
|
shardId: client.shard.ids[0]
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
const logger = require('../../services/logger');
|
exports.getUptimeFormatted = async ({ executionId }) => {
|
||||||
|
const logger = require('../../services/logger').child({
|
||||||
|
source: 'getUptimeFormatted.js',
|
||||||
|
module: 'utilSystem',
|
||||||
|
name: 'getUptimeFormatted',
|
||||||
|
executionId: executionId
|
||||||
|
});
|
||||||
|
|
||||||
exports.getUptimeFormatted = async () => {
|
|
||||||
try {
|
try {
|
||||||
let uptimeFormattedString = '';
|
let uptimeFormattedString = '';
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const { EmbedBuilder } = require('discord.js');
|
|||||||
exports.cannotJoinVoiceOrTalk = async ({ interaction, executionId }) => {
|
exports.cannotJoinVoiceOrTalk = async ({ interaction, executionId }) => {
|
||||||
const logger = require('../../services/logger').child({
|
const logger = require('../../services/logger').child({
|
||||||
source: 'permissionValidator.js',
|
source: 'permissionValidator.js',
|
||||||
module: 'validator',
|
module: 'utilValidation',
|
||||||
name: 'cannotJoinVoiceOrTalk',
|
name: 'cannotJoinVoiceOrTalk',
|
||||||
executionId: executionId,
|
executionId: executionId,
|
||||||
shardId: interaction.guild.shardId,
|
shardId: interaction.guild.shardId,
|
||||||
@@ -37,7 +37,7 @@ exports.cannotJoinVoiceOrTalk = async ({ interaction, executionId }) => {
|
|||||||
exports.cannotSendMessageInChannel = async ({ interaction, executionId }) => {
|
exports.cannotSendMessageInChannel = async ({ interaction, executionId }) => {
|
||||||
const logger = require('../../services/logger').child({
|
const logger = require('../../services/logger').child({
|
||||||
source: 'permissionValidator.js',
|
source: 'permissionValidator.js',
|
||||||
module: 'validator',
|
module: 'utilValidation',
|
||||||
name: 'cannotSendMessageInChannel',
|
name: 'cannotSendMessageInChannel',
|
||||||
executionId: executionId,
|
executionId: executionId,
|
||||||
shardId: interaction.guild.shardId,
|
shardId: interaction.guild.shardId,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const { EmbedBuilder } = require('discord.js');
|
|||||||
exports.queueDoesNotExist = async ({ interaction, queue, executionId }) => {
|
exports.queueDoesNotExist = async ({ interaction, queue, executionId }) => {
|
||||||
const logger = require('../../services/logger').child({
|
const logger = require('../../services/logger').child({
|
||||||
source: 'queueValidator.js',
|
source: 'queueValidator.js',
|
||||||
module: 'validator',
|
module: 'utilValidation',
|
||||||
name: 'queueDoesNotExist',
|
name: 'queueDoesNotExist',
|
||||||
executionId: executionId,
|
executionId: executionId,
|
||||||
shardId: interaction.guild.shardId,
|
shardId: interaction.guild.shardId,
|
||||||
@@ -33,7 +33,7 @@ exports.queueDoesNotExist = async ({ interaction, queue, executionId }) => {
|
|||||||
exports.queueNoCurrentTrack = async ({ interaction, queue, executionId }) => {
|
exports.queueNoCurrentTrack = async ({ interaction, queue, executionId }) => {
|
||||||
const logger = require('../../services/logger').child({
|
const logger = require('../../services/logger').child({
|
||||||
source: 'queueValidator.js',
|
source: 'queueValidator.js',
|
||||||
module: 'validator',
|
module: 'utilValidation',
|
||||||
name: 'queueNoCurrentTrack',
|
name: 'queueNoCurrentTrack',
|
||||||
executionId: executionId,
|
executionId: executionId,
|
||||||
shardId: interaction.guild.shardId,
|
shardId: interaction.guild.shardId,
|
||||||
@@ -61,7 +61,7 @@ exports.queueNoCurrentTrack = async ({ interaction, queue, executionId }) => {
|
|||||||
exports.queueIsEmpty = async ({ interaction, queue, executionId }) => {
|
exports.queueIsEmpty = async ({ interaction, queue, executionId }) => {
|
||||||
const logger = require('../../services/logger').child({
|
const logger = require('../../services/logger').child({
|
||||||
source: 'queueValidator.js',
|
source: 'queueValidator.js',
|
||||||
module: 'validator',
|
module: 'utilValidation',
|
||||||
name: 'queueIsEmpty',
|
name: 'queueIsEmpty',
|
||||||
executionId: executionId,
|
executionId: executionId,
|
||||||
shardId: interaction.guild.shardId,
|
shardId: interaction.guild.shardId,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
exports.transformQuery = async ({ query, executionId }) => {
|
exports.transformQuery = async ({ query, executionId }) => {
|
||||||
const logger = require('../../services/logger').child({
|
const logger = require('../../services/logger').child({
|
||||||
source: 'searchQueryValidator.js',
|
source: 'searchQueryValidator.js',
|
||||||
module: 'validator',
|
module: 'utilValidation',
|
||||||
name: 'transformQuery',
|
name: 'transformQuery',
|
||||||
executionId: executionId
|
executionId: executionId
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const { EmbedBuilder } = require('discord.js');
|
|||||||
exports.notValidGuildId = async ({ interaction, executionId }) => {
|
exports.notValidGuildId = async ({ interaction, executionId }) => {
|
||||||
const logger = require('../../services/logger').child({
|
const logger = require('../../services/logger').child({
|
||||||
source: 'systemCommandValidator.js',
|
source: 'systemCommandValidator.js',
|
||||||
module: 'validator',
|
module: 'utilValidation',
|
||||||
name: 'notValidGuildId',
|
name: 'notValidGuildId',
|
||||||
executionId: executionId,
|
executionId: executionId,
|
||||||
shardId: interaction.guild.shardId,
|
shardId: interaction.guild.shardId,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ exports.notInVoiceChannel = async ({ interaction, executionId }) => {
|
|||||||
exports.notInSameVoiceChannel = async ({ interaction, queue, executionId }) => {
|
exports.notInSameVoiceChannel = async ({ interaction, queue, executionId }) => {
|
||||||
const logger = require('../../services/logger').child({
|
const logger = require('../../services/logger').child({
|
||||||
source: 'voiceChannelValidator.js',
|
source: 'voiceChannelValidator.js',
|
||||||
module: 'validator',
|
module: 'utilValidation',
|
||||||
name: 'notInSameVoiceChannel',
|
name: 'notInSameVoiceChannel',
|
||||||
executionId: executionId,
|
executionId: executionId,
|
||||||
shardId: interaction.guild.shardId,
|
shardId: interaction.guild.shardId,
|
||||||
|
|||||||
Reference in new issue
Block a user