fix: more type annotation

This commit is contained in:
Marius Begby committed 2023-08-30 14:12:55 +02:00
1 parent 3ac692d8eb
commit 2560f0fe9a
65 files changed
+408 -343

No files matched your search

+3 -3
View File
@@ -1,5 +1,5 @@
import { Logger } from 'pino';
import { v4 as uuidv4 } from 'uuid';
import loggerModule from '../../services/logger';
module.exports = {
@@ -7,8 +7,8 @@ module.exports = {
isDebug: true,
isPlayerEvent: false,
execute: async (message: string) => {
const executionId = uuidv4();
const logger = loggerModule.child({
const executionId: string = uuidv4();
const logger: Logger = loggerModule.child({
source: 'generalDebug.js',
module: 'event',
name: 'playerGeneralDebug',
+4 -4
View File
@@ -1,7 +1,7 @@
import config from 'config';
import { BaseGuildTextChannel, EmbedBuilder } from 'discord.js';
import { Logger } from 'pino';
import { v4 as uuidv4 } from 'uuid';
import loggerModule from '../../services/logger';
import { BotOptions, EmbedOptions, SystemOptions } from '../../types/configTypes';
import { ExtendedGuildQueuePlayerNode } from '../../types/eventTypes';
@@ -15,8 +15,8 @@ module.exports = {
isDebug: false,
isPlayerEvent: true,
execute: async (queue: ExtendedGuildQueuePlayerNode, error: Error) => {
const executionId = uuidv4();
const logger = loggerModule.child({
const executionId: string = uuidv4();
const logger: Logger = loggerModule.child({
source: 'generalError.js',
module: 'event',
name: 'playerGeneralError',
@@ -39,7 +39,7 @@ module.exports = {
});
if (systemOptions.systemMessageChannelId && systemOptions.systemUserId) {
const channel = (await queue.metadata?.client.channels.cache.get(
const channel: BaseGuildTextChannel = (await queue.metadata?.client.channels.cache.get(
systemOptions.systemMessageChannelId
)) as BaseGuildTextChannel;
if (channel) {
+3 -3
View File
@@ -1,5 +1,5 @@
import { Logger } from 'pino';
import { v4 as uuidv4 } from 'uuid';
import loggerModule from '../../services/logger';
module.exports = {
@@ -7,8 +7,8 @@ module.exports = {
isDebug: true,
isPlayerEvent: true,
execute: async (message: string) => {
const executionId = uuidv4();
const logger = loggerModule.child({
const executionId: string = uuidv4();
const logger: Logger = loggerModule.child({
source: 'playerDebug.js',
module: 'event',
name: 'playerDebug',
+4 -4
View File
@@ -1,7 +1,7 @@
import config from 'config';
import { BaseGuildTextChannel, EmbedBuilder } from 'discord.js';
import { Logger } from 'pino';
import { v4 as uuidv4 } from 'uuid';
import loggerModule from '../../services/logger';
import { BotOptions, EmbedOptions, SystemOptions } from '../../types/configTypes';
import { ExtendedGuildQueuePlayerNode } from '../../types/eventTypes';
@@ -15,8 +15,8 @@ module.exports = {
isDebug: false,
isPlayerEvent: true,
execute: async (queue: ExtendedGuildQueuePlayerNode, error: Error) => {
const executionId = uuidv4();
const logger = loggerModule.child({
const executionId: string = uuidv4();
const logger: Logger = loggerModule.child({
source: 'playerError.js',
module: 'event',
name: 'playerError',
@@ -39,7 +39,7 @@ module.exports = {
});
if (systemOptions.systemMessageChannelId && systemOptions.systemUserId) {
const channel = (await queue.metadata?.client.channels.cache.get(
const channel: BaseGuildTextChannel = (await queue.metadata?.client.channels.cache.get(
systemOptions.systemMessageChannelId
)) as BaseGuildTextChannel;
if (channel) {
+4 -4
View File
@@ -1,8 +1,8 @@
import config from 'config';
import { Track } from 'discord-player';
import { BaseGuildTextChannel, EmbedBuilder } from 'discord.js';
import { Logger } from 'pino';
import { v4 as uuidv4 } from 'uuid';
import loggerModule from '../../services/logger';
import { BotOptions, EmbedOptions, SystemOptions } from '../../types/configTypes';
import { ExtendedGuildQueuePlayerNode } from '../../types/eventTypes';
@@ -16,8 +16,8 @@ module.exports = {
isDebug: false,
isPlayerEvent: true,
execute: async (queue: ExtendedGuildQueuePlayerNode, track: Track) => {
const executionId = uuidv4();
const logger = loggerModule.child({
const executionId: string = uuidv4();
const logger: Logger = loggerModule.child({
source: 'playerSkip.js',
module: 'event',
name: 'playerSkip',
@@ -40,7 +40,7 @@ module.exports = {
});
if (systemOptions.systemMessageChannelId && systemOptions.systemUserId) {
const channel = (await queue.metadata?.client.channels.cache.get(
const channel: BaseGuildTextChannel = (await queue.metadata?.client.channels.cache.get(
systemOptions.systemMessageChannelId
)) as BaseGuildTextChannel;
if (channel) {
+3 -3
View File
@@ -1,6 +1,6 @@
import { Track } from 'discord-player';
import { Logger } from 'pino';
import { v4 as uuidv4 } from 'uuid';
import loggerModule from '../../services/logger';
import { ExtendedGuildQueuePlayerNode } from '../../types/eventTypes';
@@ -9,8 +9,8 @@ module.exports = {
isDebug: false,
isPlayerEvent: true,
execute: async (queue: ExtendedGuildQueuePlayerNode, track: Track) => {
const executionId = uuidv4();
const logger = loggerModule.child({
const executionId: string = uuidv4();
const logger: Logger = loggerModule.child({
source: 'playerStart.js',
module: 'event',
name: 'playerStart',