niles-bot / niles

Niles - a Discord bot for interfacing with Google Calendar
http://nilesbot.com
MIT License
61 stars 22 forks source link

Announcement channels not being updated #179

Closed mchangrh closed 3 years ago

mchangrh commented 3 years ago

for some reason, announcement channels receive periodic "unknown message" errors. There is not specific documented reason why this should be the case, but there have been a few select bots that also have issues fetching from announcement channels.

a minimal code sample: https://static.mchang.xyz/niles/179-mcve.gitbundle

next step is to run it on a timer and see if it returns errors periodically

mchangrh commented 3 years ago

Found the source:

Discord has an undocumented ratelimit for editing messages in announcement channels. This obviously conflicts with Niles, so announcement channels will have to be banned by checking for channel.type !== news

I will clean up the code and release a proper MCVE

Edit: MCVE - https://static.mchang.xyz/niles/179-mcve.gitbundle

mchangrh commented 3 years ago

Update: Discord has undocumented but enforced ratelimits for both published and unpublished messages. These cannot and will not be bypassed. Announcement channels will be blocked in 4.5.4

mchangrh commented 3 years ago

Errors and symptoms

So what happened was Niles would give out an error of "unknown message" and in large, large quantities (200+) On the server side, there would be errors indicating the guild had an unknown message, also in extremely large quantities

Troubleshooting

Solution

After some messing around manually, it seemed that announcement channels were limited to (x edits in x duration) - this ratelimit changes without warning so it will not be documented

it was much too low for Niles to ratelimit down to or even maintain as an update rate so news channels were banned and now throw errors.