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] Messages should be deleted if a user is banned / timed out #115

Open
eldemiandx opened this issue Nov 27, 2024 · 3 comments
Open
Assignees
Labels
bug Something isn't working chatbox Issues related to the chatbox widget enhancement New feature or request
Milestone

Comments

@eldemiandx
Copy link

eldemiandx commented Nov 27, 2024

Describe the bug

When a Twitch message is deleted, the user is banned or timeout, the messages continue to appear.

Screenshots

Attempt to delete a message:
streamerbot-chat
widget-chat

Attempt to ban a user:
streamerbot-chat2
widget-chat2

Additional context

  • Streamer.bot 0.2.6
  • v.0.4.0-beta_3.6.1
@eldemiandx eldemiandx added the bug Something isn't working label Nov 27, 2024
@BlackyWhoElse BlackyWhoElse changed the title [Bug] Twitch Messages are not delete [Feature] Messages should be deleted if a user is banned / timed out Nov 28, 2024
@BlackyWhoElse BlackyWhoElse self-assigned this Nov 28, 2024
@BlackyWhoElse BlackyWhoElse added enhancement New feature or request chatbox Issues related to the chatbox widget labels Nov 28, 2024
@BlackyWhoElse BlackyWhoElse added this to the v.0.4.0 milestone Nov 28, 2024
@BlackyWhoElse
Copy link
Owner

I will add the {{userId}} to the message container so that I can note it in the event when a user is “timed out” or “locked”.

Event:

[ moderation/ban-user ] && [ moderation/timeout-user ]

Logic:

We add a new function to get all the user's messages that are currently in the msg container, and then delete each one using the standard removeMessage function.

It will be easier to have the deletion logic in one place.

removeMessagebyUid({{bannedUserId}}) -> removeMessage()

Note:

Since I'm moving and Christmas is coming up, I'll try to get it done by the new year, but can't promise anything.

@eldemiandx
Copy link
Author

Good luck and have a nice year.

@BlackyWhoElse
Copy link
Owner

I have added the first proof of concept 2eb407c.
This is only tested with twitch and only locally, but it should also work with youtube.

Note

For anyone using a custom theme, they will need to add the following
data-user-id=“{{userId}}” to the li elements, otherwise this will not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chatbox Issues related to the chatbox widget enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants