mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 14:38:49 +00:00
fix: Update validators with new types
This commit is contained in:
1 parent
af6bdd4da8
commit
e67d0004b0
7 files changed
+39
-73
No files matched your search
@@ -8,14 +8,13 @@ import {
|
||||
VoiceBasedChannel,
|
||||
VoiceChannel
|
||||
} from 'discord.js';
|
||||
|
||||
import { Logger } from 'pino';
|
||||
import loggerModule from '../../services/logger';
|
||||
import { EmbedOptions } from '../../types/configTypes';
|
||||
import { CannotJoinVoiceOrTalkParams, CannotSendMessageInChannelParams } from '../../types/utilTypes';
|
||||
import { ValidatorParams } from '../../types/utilTypes';
|
||||
|
||||
const embedOptions: EmbedOptions = config.get('embedOptions');
|
||||
export const cannotJoinVoiceOrTalk = async ({ interaction, executionId }: CannotJoinVoiceOrTalkParams) => {
|
||||
export const cannotJoinVoiceOrTalk = async ({ interaction, executionId }: ValidatorParams) => {
|
||||
const logger: Logger = loggerModule.child({
|
||||
module: 'utilValidation',
|
||||
name: 'cannotJoinVoiceOrTalk',
|
||||
@@ -49,7 +48,7 @@ export const cannotJoinVoiceOrTalk = async ({ interaction, executionId }: Cannot
|
||||
return false;
|
||||
};
|
||||
|
||||
export const cannotSendMessageInChannel = async ({ interaction, executionId }: CannotSendMessageInChannelParams) => {
|
||||
export const cannotSendMessageInChannel = async ({ interaction, executionId }: ValidatorParams) => {
|
||||
const logger: Logger = loggerModule.child({
|
||||
module: 'utilValidation',
|
||||
name: 'cannotSendMessageInChannel',
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import config from 'config';
|
||||
import { EmbedBuilder, InteractionType } from 'discord.js';
|
||||
|
||||
import { Logger } from 'pino';
|
||||
import loggerModule from '../../services/logger';
|
||||
import { EmbedOptions } from '../../types/configTypes';
|
||||
import { QueueDoesNotExistParams, QueueIsEmptyParams, QueueNoCurrentTrackParams } from '../../types/utilTypes';
|
||||
import { Logger } from 'pino';
|
||||
import { ValidatorParams } from '../../types/utilTypes';
|
||||
|
||||
const embedOptions: EmbedOptions = config.get('embedOptions');
|
||||
export const queueDoesNotExist = async ({ interaction, queue, executionId }: QueueDoesNotExistParams) => {
|
||||
export const queueDoesNotExist = async ({ interaction, queue, executionId }: ValidatorParams) => {
|
||||
const logger: Logger = loggerModule.child({
|
||||
module: 'utilValidation',
|
||||
name: 'queueDoesNotExist',
|
||||
@@ -37,7 +36,7 @@ export const queueDoesNotExist = async ({ interaction, queue, executionId }: Que
|
||||
return false;
|
||||
};
|
||||
|
||||
export const queueNoCurrentTrack = async ({ interaction, queue, executionId }: QueueNoCurrentTrackParams) => {
|
||||
export const queueNoCurrentTrack = async ({ interaction, queue, executionId }: ValidatorParams) => {
|
||||
const logger: Logger = loggerModule.child({
|
||||
module: 'utilValidation',
|
||||
name: 'queueNoCurrentTrack',
|
||||
@@ -49,7 +48,7 @@ export const queueNoCurrentTrack = async ({ interaction, queue, executionId }: Q
|
||||
const interactionIdentifier =
|
||||
interaction.type === InteractionType.ApplicationCommand ? interaction.commandName : interaction.customId;
|
||||
|
||||
if (!queue.currentTrack) {
|
||||
if (queue && !queue.currentTrack) {
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
@@ -67,7 +66,7 @@ export const queueNoCurrentTrack = async ({ interaction, queue, executionId }: Q
|
||||
return false;
|
||||
};
|
||||
|
||||
export const queueIsEmpty = async ({ interaction, queue, executionId }: QueueIsEmptyParams) => {
|
||||
export const queueIsEmpty = async ({ interaction, queue, executionId }: ValidatorParams) => {
|
||||
const logger: Logger = loggerModule.child({
|
||||
module: 'utilValidation',
|
||||
name: 'queueIsEmpty',
|
||||
@@ -79,7 +78,7 @@ export const queueIsEmpty = async ({ interaction, queue, executionId }: QueueIsE
|
||||
const interactionIdentifier =
|
||||
interaction.type === InteractionType.ApplicationCommand ? interaction.commandName : interaction.customId;
|
||||
|
||||
if (queue.tracks.data.length === 0) {
|
||||
if (queue && queue.tracks.data.length === 0) {
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import config from 'config';
|
||||
import { EmbedBuilder, InteractionType } from 'discord.js';
|
||||
|
||||
import { Logger } from 'pino';
|
||||
import loggerModule from '../../services/logger';
|
||||
import { EmbedOptions, SystemOptions } from '../../types/configTypes';
|
||||
import { NotValidGuildIdParams } from '../../types/utilTypes';
|
||||
import { Logger } from 'pino';
|
||||
import { ValidatorParams } from '../../types/utilTypes';
|
||||
|
||||
const embedOptions: EmbedOptions = config.get('embedOptions');
|
||||
const systemOptions: SystemOptions = config.get('systemOptions');
|
||||
export const notValidGuildId = async ({ interaction, executionId }: NotValidGuildIdParams) => {
|
||||
export const notValidGuildId = async ({ interaction, executionId }: ValidatorParams) => {
|
||||
const logger: Logger = loggerModule.child({
|
||||
module: 'utilValidation',
|
||||
name: 'notValidGuildId',
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import config from 'config';
|
||||
import { EmbedBuilder, GuildMember, InteractionType } from 'discord.js';
|
||||
|
||||
import { Logger } from 'pino';
|
||||
import loggerModule from '../../services/logger';
|
||||
import { EmbedOptions } from '../../types/configTypes';
|
||||
import { NotInSameVoiceChannelParams, NotInVoiceChannelParams } from '../../types/utilTypes';
|
||||
import { ValidatorParams } from '../../types/utilTypes';
|
||||
|
||||
const embedOptions: EmbedOptions = config.get('embedOptions');
|
||||
export const notInVoiceChannel = async ({ interaction, executionId }: NotInVoiceChannelParams) => {
|
||||
export const notInVoiceChannel = async ({ interaction, executionId }: ValidatorParams) => {
|
||||
const logger: Logger = loggerModule.child({
|
||||
module: 'validator',
|
||||
name: 'notInVoiceChannel',
|
||||
@@ -37,7 +36,7 @@ export const notInVoiceChannel = async ({ interaction, executionId }: NotInVoice
|
||||
return false;
|
||||
};
|
||||
|
||||
export const notInSameVoiceChannel = async ({ interaction, queue, executionId }: NotInSameVoiceChannelParams) => {
|
||||
export const notInSameVoiceChannel = async ({ interaction, queue, executionId }: ValidatorParams) => {
|
||||
const logger: Logger = loggerModule.child({
|
||||
module: 'utilValidation',
|
||||
name: 'notInSameVoiceChannel',
|
||||
|
||||
Reference in new issue
Block a user