#Code doesn't `return` (I still need help)
91 messages · Page 1 of 1 (latest)
Please ping me when you answer
im confused. theres no return in the code block which you claim logs continued
So why do you think it would be returning?
The function has it
That won't work?
return exits the function
its working
It doesnt return from anything but that function
It returns back to where the function was executed
oh
How can I return from the main file as well?
I tried it but this happened
I tried using
if (notEnoughPermissions){return}but it returns everytime that way, even if it has the permissions.
notEnoughPermissions needs to return a boolean to that if
Otherwise how is it supposed to know?
You arent calling the function though
The function takes 5 parameters
I think you might need to learn a bit more Javascript
I have them
Well, that function is notEnoughChannelPermissionsEmbed which would be different to notEnoughPermissions
But I do const
But for it to work, you need to pass those 5 things to the function when you call it
you... what
why do i need to call it like that again?
oh, I missed code in your screenshot
This doesn't work?
oh okay
well, yes
Your code does not attempt to return
So in order to make it recieve a boolean
I need to add something inside the function?
It just console.logs true
Then continues
I tried before
it returns even if it has permissions
That if gets always triggered that way
idk why
Then your function is wrong
And it always returning true
Can I force it to return false by just adding else {return false} ?
idk how to make it return false in this case
because thats the whole copde i sent you
yes
there is nothing else
but that wont fix anything if its already returning true all the time
Want me to send screenshot or code
Which one is easier to read?
code
but theres not much else I can see
Its always returning true
It always logs enough permissions and continued even if it doesn't have those permissions
yes
yes
well.... you now have a double negative?
notEnoughPermissions returns true....
Then you do if(!notEnoughPermissions)
not-notEnoughPermissions
But does it matter?
let me fixc ok one sec
Yes, thats why I'm pointing it out 
Having incorrect logic in your if matters a lot
Still the same thjing though
await notEnoughPermissions;
if (notEnoughPermissions) {
console.log("enough permissions");
} else {
console.log("not enough permissions");
return;
}```
Still logging enough permissions even if it has not
I don't get it 😦
I wasted 3 hours on this
I can't understand the logic behind this
I dont think not enoughpermissions returns a promise so why await it. I think you need to brush up on your js skills. 👍
I just did that for test
There is no await normally
If you knew it didn’t return a promise why “try” it? Doesn’t change anything in your code
Because this code doesn't work for a reason, so I try stupid stuff
Please don't argue about this if you are not going to help
I'm already exhausted
I’m not arguing. Stating what your code says
unrelevant with the issue I have, thanks
Please stop and leave the post so the mods can see the code message
Otherwise it won't be visible (the more you write the more it goes to the top)
Heres what i think. You have a promising thing here just don’t completely grasp the logic for some of it. Please learn some more js. But when someone helps you and points something out, getting offensive helps nothing
My guy...
That was something I did because the issue already doesn't make sense, so I tried something that doesn't make sense. Please STOP! (it doesn't exist anymore in the code I originally have. That has nothing to do with this anyways)
notEnoughPermissions is supposed to be what?
Code doesn't return (I still need help)
You make fun of my coding skills but you can't even see what that is?
Or are you doing this on purpose despite me saying please stop?
I’m not making fun of your skills. I literally said it was promising code. Have you logged what notEnoughPermissions is?
Look, I am thankful for you trying to help me, but please stop writing here. I kindly want you to ignore my post.
In order for an if statement to work, what’s inside have to return true or false.
I don't want to explain to you what this code does since it is clear
Yes, I know
You mean this one doesn't?
Well it needs the condition to return true or false
For the if to work
You are just telling stuff that we already know though
We know that, the issue is that I don't know why this one doesn't
Please stop writing here so I don't have to send the code multiple times here, other wise mods might think this issue has been solved
Well ok. Have a nice day. Gl