-
-
Notifications
You must be signed in to change notification settings - Fork 105
feat(DynamicVoiceChat): implement main logic #1370
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
base: develop
Are you sure you want to change the base?
Conversation
Co-authored-by: Suraj Kumar <76599223+surajkumar@users.noreply.github.com> Signed-off-by: Chris Sdogkos <work@chris-sdogkos.com>
Using 'Logger#info' is too spammy in the console, use 'Logger#trace' instead. Signed-off-by: Chris Sdogkos <work@chris-sdogkos.com>
Signed-off-by: Chris Sdogkos <work@chris-sdogkos.com>
Signed-off-by: Chris Sdogkos <work@chris-sdogkos.com>
tj-wazei
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy with this and have tested.
| channel.delete() | ||
| .queue(_ -> logger.trace("Deleted dynamically created voice channel: {} ", | ||
| channel.getName()), | ||
| error -> logger.error("Failed to delete dynamically created voice channel: {} ", | ||
| channel.getName(), error)); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would kinda prefer if this workflow will post a warning in the voice channel chat with a specific timer for deletion (30sec) or whatever, then checking again for memberCount == 0 and then actually deleting or otherwise stopping the workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about this when reviewing and decided to skip past a timer. There is a message sent when the channel is created and there's really no need to keep the channel longer. It can be recreated right away anyway.
Having said this, I am now thinking about moderation...
Temp voice chat -> users posting nonsense -> evidence deleted ...?
Perhaps instead of deleting the channel, we can move it to a private/mod-only voice-chat-archive channel so only we can still check chats. Followed by a daily clean up task.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds great, we need to keep track of what people post in these ephemeral channels. Perhaps instead of deleting, send a log of all the messages sent as one embed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll hit the character limit very quickly with an embed. It's best to just hide the channel so only moderators can see this and clean up after some time period.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say it is best if we keep it as it is now and add such functionality later on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try to push a temporary solution today so that moderation is still possible with these ephemeral voice channels. Feel free to resolve this thread once you are fine with the pushed implementation.
|
Would love to carry this feature forward, got permission from @christolis |
|
Just some things to note: "Support/Studying Room" with no numbers produces the desired result of TJ creating a temp channel for the user and deleting it when everyone leaves the channel. "Support/Studying Room" with any number after it (1,2,3,4) does not produce a temp channel, and the channel itself it deleted after everyone leaves the channel. This brings me to the question of when this gets implemented, will we have only one channel, "Support/Studying Room", with no numbers? If so, this does not need to be addressed. If there will still be 4 different studying channels as it is currently, this is something that will need to be handled. Just wanted to confirm before tackling that, since it's not really an issue per se if the channel is just "Support/Studying Room" with no numbers |
Signed-off-by: Chris Sdogkos <work@chris-sdogkos.com>
Currently there is no way to moderate ephemeral voice channels. Members could very easily break the rules in the channel, send NSFW content and it can go undetected by the moderation team. Introduce a new archival system where the ephemeral voice channels are instead stored in an archival category. Depending on the archival strategy, channels are removed once they are not needed any more. Routines are not being used since we are able to get away with attempting cleanup every time a user leaves an ephemeral voice channel. This results in superior performance and no scheduling involved. Do _not_ archive ephemeral voice channels with no contents sent by members. Signed-off-by: Chris Sdogkos <work@chris-sdogkos.com>
|
@Zachdehooge I apologize for not responding to your question promptly.
On 1/11/26 19:40, Zach wrote:
Zachdehooge left a comment (Together-Java/TJ-Bot#1370)
This brings me to the question of when this gets implemented, will we have only one channel, "Support/Studying Room", with no numbers? If so, this does not need to be addressed.
I assume that this is going to be the case. It will need to be handled
by an authorized member of our community to update the channels
appropriately though.
Just wanted to confirm before tackling that
Absolutely, and thank you for asking that :)
|
This is why breaks are important, I committed my previous changes while being hungry... Set realistic constant values for CLEAN_CHANNELS_AMOUNT and MINIMUM_CHANNELS_AMOUNT so that more channels are kept in the archive. Signed-off-by: Chris Sdogkos <work@chris-sdogkos.com>
| messageHistory.retrievePast(2).queue(messages -> { | ||
| // Don't forget that there is always one | ||
| // embed message sent by the bot every time. | ||
| if (messages.size() > 1) { | ||
| archiveDynamicVoiceChannel(channelLeft); | ||
| } else { | ||
| channelLeft.delete().queue(); | ||
| } | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you simply use MessageHistory#size instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to make use of MessageHistory#size, a method like MessageHistory#retrievePast needs to be invoked first because otherwise the size method will always return 0 regardless of the channel's history.
| public final class DynamicVoiceChat extends VoiceReceiverAdapter { | ||
| private static final Logger logger = LoggerFactory.getLogger(DynamicVoiceChat.class); | ||
|
|
||
| // @christolis: Unless somebody is willing to make the category name configurable, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the comment and adds these configurations into the config file. Thanks
The constant name is self-documenting. If someone wants to make it as well as other constants in this class configurable later, they can submit a pull request with _actual reasoning_ instead of bikeshedding over a defensive comment. The constant is hardcoded because it's _unlikely_ anyone will want to change it. If that assumption proves wrong, it's trivial to refactor. Signed-off-by: Chris Sdogkos <work@chris-sdogkos.com>
Closes #1113.
Showcase
Screen.Recording.2026-01-04.at.02.35.21.mov
Configuration changes
dynamicVoiceChannelPatterns