Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] on close/exit event #2332

Closed
lublak opened this issue Jan 5, 2024 · 8 comments
Closed

[Feature Request] on close/exit event #2332

lublak opened this issue Jan 5, 2024 · 8 comments
Labels
Enhancement A feature request or improvement
Projects

Comments

@lublak
Copy link

lublak commented Jan 5, 2024

Describe the solution you'd like

it would be cool if there was not only a start event but also a close event.
At the end of the stream I like to switch to Emojichat only. The reason for this is that after the stream ends and the bot is closed, there is no more moderation. Because all commands run via this bot.
Means, in general an event would be useful which reacts shortly before firebot is closed to switch the chat automatically.

@lublak lublak added the Enhancement A feature request or improvement label Jan 5, 2024
@github-actions github-actions bot added this to Backlog in Work Status Jan 5, 2024
@dennisrijsdijk
Copy link
Contributor

Personally I do this by hooking into OBS Stream Started and OBS Stream Ended. in update 5.60 there'll also be events for Twitch Stream Started and Twitch Stream Ended which you should be able to use for this, but I agree that a Firebot Closing type of event would be useful for cleanup as well.

@lublak
Copy link
Author

lublak commented Jan 5, 2024

@dennisrijsdijk Yes, that would also work. just Twitch stream started and ended.
You would have to be careful not to close firebot first. I will definitely use it like this for the time being :)

@Firebottle
Copy link
Collaborator

@dennisrijsdijk @lublak with 5.60 out the door, is this ticket still needed or do you have everything you need now?

@dennisrijsdijk
Copy link
Contributor

I think a "Firebot Closed" event would still be distinct, and useful in its own way, so please keep this issue open.

@JoeruCodes
Copy link
Contributor

JoeruCodes commented Jan 7, 2024

image

Where should set the trigger of the event? Should I do it using the 'before-quit' event of electron or should I do it within the 'close' event of electron as highlighted respectively?

Or maybe i can directly trigger it in the main.js like so...
image

@dennisrijsdijk
Copy link
Contributor

I would say this is probably best left to the core dev team. @zunderscore or @ebiggz thoughts?

@ebiggz
Copy link
Member

ebiggz commented Jan 7, 2024

Cool idea!

@JOELPOG Thanks for looking into implementing this. I think it would make the most sense to put this in the willClose event callback. I just pushed up some tweaks to the v5 branch to better support asynchronous close logic needed for it. With that in place, you should be able to trigger the "Firebot close" event in there:
image

@JoeruCodes
Copy link
Contributor

Thank you! However, might there be a concern about potential memory leaks when directly calling the backend functions right?

@zunderscore zunderscore moved this from Backlog to Release Pending in Work Status Jan 14, 2024
@github-actions github-actions bot added Dev Complete Release Pending Issue has been resolved and is waiting to be packaged as part of a release labels Jan 14, 2024
@SReject SReject closed this as completed Feb 16, 2024
Work Status automation moved this from Release Pending to Closed Feb 16, 2024
@github-actions github-actions bot removed Dev Complete Release Pending Issue has been resolved and is waiting to be packaged as part of a release labels Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A feature request or improvement
Projects
Work Status
  
Closed
Development

No branches or pull requests

6 participants