Skip to content

Conversation

@christolis
Copy link
Member

@christolis christolis commented Jan 4, 2026

Closes #1113.

Showcase

Screen.Recording.2026-01-04.at.02.35.21.mov

Configuration changes

Property Description Type
dynamicVoiceChannelPatterns List of voice channel patterns to manage dynamically. List[String]

Co-authored-by: Suraj Kumar <76599223+surajkumar@users.noreply.github.com>
Signed-off-by: Chris Sdogkos <work@chris-sdogkos.com>
@christolis christolis requested a review from a team as a code owner January 4, 2026 00:31
@christolis christolis marked this pull request as draft January 4, 2026 00:31
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>
@christolis christolis added config-changes if your PR contains any changes related to config file java Pull requests that update java code enhancement New feature or request labels Jan 4, 2026
@christolis christolis marked this pull request as ready for review January 4, 2026 11:09
tj-wazei
tj-wazei previously approved these changes Jan 4, 2026
Copy link
Contributor

@tj-wazei tj-wazei left a 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.

Comment on lines 94 to 99
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));
}
Copy link
Member

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

Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member

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

Copy link
Member Author

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.

@tj-wazei tj-wazei self-requested a review January 5, 2026 15:50
@Zachdehooge
Copy link
Contributor

Would love to carry this feature forward, got permission from @christolis

@Zachdehooge
Copy link
Contributor

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>
@christolis christolis requested a review from SquidXTV January 20, 2026 12:01
@christolis
Copy link
Member Author

christolis commented Jan 20, 2026 via email

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>
Comment on lines +67 to +75
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();
}
});
Copy link
Member

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?

Copy link
Member Author

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.

SquidXTV
SquidXTV previously approved these changes Jan 20, 2026
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,
Copy link
Contributor

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config-changes if your PR contains any changes related to config file enhancement New feature or request java Pull requests that update java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamically create and delete voice channels based on activity

4 participants