File tree Expand file tree Collapse file tree
src/main/java/technobot/commands/staff Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package technobot .commands .staff ;
22
33import net .dv8tion .jda .api .Permission ;
4+ import net .dv8tion .jda .api .entities .ChannelType ;
45import net .dv8tion .jda .api .entities .Role ;
56import net .dv8tion .jda .api .entities .TextChannel ;
67import net .dv8tion .jda .api .events .interaction .command .SlashCommandInteractionEvent ;
@@ -41,6 +42,13 @@ public void execute(SlashCommandInteractionEvent event) {
4142 return ;
4243 }
4344
45+ // Prevent slowmode in threads
46+ ChannelType type = event .getChannelType ();
47+ if (type == ChannelType .GUILD_PUBLIC_THREAD || type == ChannelType .GUILD_NEWS_THREAD || type == ChannelType .GUILD_PRIVATE_THREAD ) {
48+ event .replyEmbeds (EmbedUtils .createError ("You cannot set slowmode on threads!" )).queue ();
49+ return ;
50+ }
51+
4452 OptionMapping timeOption = event .getOption ("time" );
4553 if (timeOption != null ) {
4654 // Retrieve time in seconds from input
You can’t perform that action at this time.
0 commit comments