29 Replies
I have this listener which adds all the text channels in a discord server to a table in a database. It appears to be triggering twice with the second time containing the right data from the channel.:
This is the code to add:
it creates two records
@Helpers please
Firstly you are showing two different listeners for stuff
wdym two different listeners
But it also looks like whatever you're doing with ids isn't going smoothly because i see them encountering rounding errors
Ready and channel create
I'd check your sql stuff instead
i have two listener files that have onready
this is the structure
We'll need more info because i don't see how it's related to once
Each listener will only run once if one is set to true
You have two ready listeners -> each will run only once
yep
but i end up triggering
ReadyMessageLogsDBListener
twice
cos of that RECEIVED CHANNEL NAME...
thing
its being output twiceTwo different ids tho
you suspect a rounding error?
this pair is correct btw
that id is an actual channel id in my testing server
idk where the one ending in 800 came from
Are you sure there's not just two channels with very close ids? Maybe log the channel name too
i did log the channel name
see
this is the server im testing on
Interesting
Oh
Hmm
Why do you get it twice then
1144586568296824888
1144586568296824889
these are the IDs of the text and voice channel respectively
that's what i also would like to know 😅
Where else do you call your channel add function
Because it seems to be called outside ready
Since there's no logs for adding
only 1 invocation
2nd search result
rm -rf dist, rebuild
And check again
omg
idk how that fixed it
but the ghost id is gone
Stale code or a previous listener
Thank you!
much appreciated
would've banged my head on this for ages 💀