Webhook not creating/sending
So I have a daily message system that creates a webhook if there is none or sends a embed message if the webhook exists. This all works fine in my best bot but when I try to move it to production it wont send/create the webhooks on most server. Around 200 servers use that system but the bot only made 20webhooks so far. It also cant be a permissions issue as I gave the bot admin on my dev server and it still didn't send/create anything. There is also no error logged which is weird.
This whole error is really annoying as I'm not sure how to fix it so I'm looking for help here:
Code for the daily message system: https://gist.github.com/mezotv/ccd892a7500334f54c68df31929c2e8e
Code for our webhook handler: https://gist.github.com/mezotv/2635d066c28c246020fe2890128708d3
Full code (if needed): https://github.com/Would-You-Bot/Would-You/tree/debugCommandPlusTranslateFix
55 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
We have our own caching system thats really strict so without fetching the channels it wouldnt work
Will add that!
Alright ive gone ahead and added that! Will see if that runs. Also do you think it would be smart to remove all the ?. and
Cant really tell you that as I wasnt the one who worked on that @seandev might know more
everything expect user and guild member and othet djs requited things
We dont overwrite djs cache system
our “own” is just the db cacher and webhook cacher
Yea thats what I meant
100%?
I mean at the end there is no issue by using fetch bcs it checks the cache first or not
🤔
yeah but i would go crazy if that would be the issue
I wish that was the error
bc then we finally found it
I wanted to go sleep now mean when client.user.id is not set its valid to get sweept bcs the client user is broken then
lol
or not?
ig when client user id is not set then we have a way other problems bcs this should never happen
@dominikdev
the daily msg should send about ~200 msg right?
around 200 if the bot got perms to do so
but without perms it should also send a error message
could u try to add a number upcounter like at the start of the cronjob u add something like test = 0;
and at every webhookManager.sendWrbhook() above of this function u do test++;
and then on the end of the cronjob u do a console.log(test)
do u get what i mean?
Yea sure
Alright looks something like this now above every sent
yes
Shall I push that test to production?
production
i mean at the end it wont log anything near to 200
bcs of the timezones
alright sure
Alr bot is started now
It logged 0 now which makes sense since nobody uses that timezone. It should log way more tomorrow at 12pm America/Chicago time
Hey so @qjuh @seandev The bot logged 0 now and an error
Thats def something we can work with right
Will look at that in a sec
yeah it is
so thats probably why it isnt working right
true xD
Im sorry just though you would like an update
It should not be the issue bcs we catch unhandledRejection
so the code wont stop and do the for loop
Well yea but that error gets logged in a catch
Still maybe because some value is null it wont send any webhooks etc
hard to explain rn Ill tell you what I meant later
yeah obv thats why the catch is there xD
and to notice that we have the channel?.id
to make sure its set even if a error happen
atleast we got somet sort of an error message now and can debug further
yeah add a
why debugchannel tho
sorry
ahh sure
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
let me test sth
Currently there are 27 documents so my guess would be that it adds 1 every run
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
1 webhook
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Okay 37 out of 201 dailyChannels are null
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
that command is messed up
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I think there is a boolean value that we store as a string
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
idk if that was dailymsg tho
In general we need a setup command with buttons that gives you an overview on what settings you set
That could be something we work on sky and add to the todo
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
when the user sets dailymsg to true does he check if there is a channel set
if not we can add that
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
then how do some servers not have one set
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
hmm
We should still make the whole command easier to use
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Like this yk
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
and to wy
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
welcome
putting all of these into 1 /settings command sounds the smartest to me
/settings welcome/dailymsg
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
lets add to todo before we forget
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I asked meister (the dev behind bump reminder) for help and he said he will in march
I hope we wont need his help tho because till then its a long time