Skip to content
Advertisement

Temporary mute command returning error ‘Cannot read property ‘slice’ of undefined’

I am trying to create a temporary mute command, that will unmute the muted user in the given time.

Here’s my code:

JavaScript

Currently getting the following error: Cannot read property 'slice' of undefined

Do you have any idea on how to fix the command?

edit

this after a year and this is for future people who come here

the issue was here

JavaScript

i never passed embed from my main file so args was undefined embed part was where the args should have been, I was stupid at that time and was new to coding, but as I now have some experience, I decided to edit this to show what wrong

Advertisement

Answer

It means that somewhere in your code, you have a value which is undefined and you try to use the string/array function slice on it but undefined does not have this function : so it is a error.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement