How to handle cancellations on individual reoccurring events?

I have a simple bot to clone events and announce them. a new partnership now uses reoccurring events, so i got to fix them today. I had to notice today tho that DJS does not handle cancellations of individual events, unless i don't quite understand how that works. So before I open up a feature request, I was curious, if i was missing something. I tried checking for GuildScheduledEvent#isCanceled but that does not work and canceling the whole event calls a different event (guildScheduledEventDelete) and not guildScheduledEventUpdate. But from what I can see on the GuildScheduledEvent - Structure in the docs it doesn't seem to have any fields related to these kinds of edge cases. Source Code/Repo with relevant line: https://github.com/FlippedCodes/event-cloner/blob/975cb4aaf753d9db8b9bc95c44f7c723f36aa16e/index.js#L126
GitHub
event-cloner/index.js at 975cb4aaf753d9db8b9bc95c44f7c723f36aa16e ...
This is a small utility bot that listens for events on a server to create and update them on other servers. - FlippedCodes/event-cloner
4 Replies
d.js toolkit
d.js toolkit6d ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Phil
PhilOP6d ago
$ npm list discord.js && node -v
[email protected] /mnt/eba96da4-0484-4eb9-b77b-5e13475978f2/phil/Documents/github/event-cloner

v23.11.0
$ npm list discord.js && node -v
[email protected] /mnt/eba96da4-0484-4eb9-b77b-5e13475978f2/phil/Documents/github/event-cloner

v23.11.0
duck
duck6d ago
just to elaborate from the api's perspective, a single scheduled event refers to the entire series of events, so cancelling it cancels all of them they handle events in series through a "recurrence rule" (accessible through djs from <GuildScheduledEvent>.recurrenceRule) which only determines how often the event recurs recurrence rules were only documented (and implemented in djs) within the last year, but the ability to cancel single iterations of the event recurring is recent enough that it has yet to be documented in the api djs only implements documented features, so djs does not currently support cancelling single iterations of an event
Phil
PhilOP5d ago
yea makes sense... so i guess its in discords hands when its going to be a thing for bots to access. thanks for the clarification and your time ^^

Did you find this page helpful?