File tree Expand file tree Collapse file tree 3 files changed +46
-1
lines changed
java/com/javadiscord/javabot/commands/moderation Expand file tree Collapse file tree 3 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,8 @@ private ReplyAction createEmbed(SlashCommandEvent event) {
8080 eb .setThumbnail (thumb );
8181 eb .setColor (Color .decode (color ));
8282
83- return event .replyEmbeds (eb .build ());
83+ event .getChannel ().sendMessageEmbeds (eb .build ()).queue ();
84+ return event .reply ("Done!" ).setEphemeral (true );
8485
8586 } catch (Exception e ) {
8687 return event .replyEmbeds (Embeds .emptyError ("```" + e .getMessage () + "```" , event .getUser ())).setEphemeral (Constants .ERR_EPHEMERAL );
Original file line number Diff line number Diff line change 1+ package com .javadiscord .javabot .commands .moderation ;
2+
3+ import com .javadiscord .javabot .commands .SlashCommandHandler ;
4+ import com .javadiscord .javabot .other .Constants ;
5+ import com .javadiscord .javabot .other .Database ;
6+ import com .javadiscord .javabot .other .Embeds ;
7+ import com .javadiscord .javabot .other .Misc ;
8+ import net .dv8tion .jda .api .EmbedBuilder ;
9+ import net .dv8tion .jda .api .Permission ;
10+ import net .dv8tion .jda .api .entities .Member ;
11+ import net .dv8tion .jda .api .events .interaction .SlashCommandEvent ;
12+ import net .dv8tion .jda .api .interactions .commands .OptionMapping ;
13+ import net .dv8tion .jda .api .requests .restaction .interactions .ReplyAction ;
14+
15+ import javax .imageio .ImageIO ;
16+ import javax .swing .*;
17+ import java .awt .image .BufferedImage ;
18+ import java .io .ByteArrayInputStream ;
19+ import java .io .File ;
20+ import java .net .URL ;
21+ import java .nio .file .Paths ;
22+ import java .util .Date ;
23+ import java .util .concurrent .TimeUnit ;
24+
25+ public class Say implements SlashCommandHandler {
26+
27+ @ Override
28+ public ReplyAction handle (SlashCommandEvent event ) {
29+ if (!event .getMember ().hasPermission (Permission .ADMINISTRATOR )) {
30+ return event .replyEmbeds (Embeds .permissionError ("ADMINISTRATOR" , event )).setEphemeral (Constants .ERR_EPHEMERAL );
31+ }
32+
33+ String text = event .getOption ("text" ).getAsString ();
34+
35+ event .getChannel ().sendMessage (text ).queue ();
36+ return event .reply ("Done!" ).setEphemeral (true );
37+ }
38+ }
Original file line number Diff line number Diff line change 2323 - {description: The id the bot will convert into a human-readable timestamp, name: id,
2424 required : true, type: STRING}
2525 handler : com.javadiscord.javabot.commands.user_commands.IDCalc
26+ - description : Let the bot say everything you want
27+ name : say
28+ options :
29+ - {description: The text the bot should say, name: text,
30+ required : true, type: STRING}
31+ handler : com.javadiscord.javabot.commands.moderation.Say
2632- description : Turns your text-input into a lmgtfy-link
2733 name : lmgtfy
2834 options :
You can’t perform that action at this time.
0 commit comments