Skip to content

Commit a13ed7c

Browse files
committed
Send embed notifying that voice chat is temporary
Signed-off-by: Chris Sdogkos <work@chris-sdogkos.com>
1 parent 85c79c1 commit a13ed7c

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

application/src/main/java/org/togetherjava/tjbot/features/dynamicvc/DynamicVoiceChannelListener.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.togetherjava.tjbot.features.dynamicvc;
22

3+
import net.dv8tion.jda.api.EmbedBuilder;
34
import net.dv8tion.jda.api.entities.Guild;
5+
import net.dv8tion.jda.api.entities.MessageEmbed;
46
import net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel;
57
import net.dv8tion.jda.api.entities.channel.middleman.StandardGuildChannel;
68
import net.dv8tion.jda.api.entities.channel.unions.AudioChannelUnion;
@@ -184,7 +186,19 @@ private static CompletableFuture<? extends StandardGuildChannel> makeCreateVoice
184186
return originalTopicChannel.createCopy()
185187
.setName(getNumberedChannelTopic(channelTopic, topicChannelsCount + 1))
186188
.setPosition(originalTopicChannel.getPositionRaw())
187-
.submit();
189+
.submit()
190+
.whenComplete((voiceChannel, _) -> {
191+
MessageEmbed messageEmbed = new EmbedBuilder()
192+
.addField("👋 Heads up!",
193+
"""
194+
This is a **temporary** voice chat channel. Messages sent here will be *cleared* once \
195+
the channel is deleted when everyone leaves. If you need to keep something important, \
196+
make sure to save it elsewhere. 💬
197+
""",
198+
false)
199+
.build();
200+
voiceChannel.sendMessageEmbeds(messageEmbed).queue();
201+
});
188202
}
189203

190204
return CompletableFuture.completedFuture(null);

0 commit comments

Comments
 (0)