File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
api/src/main/java/com/javadiscord/jdi/core/api
example/lj-discord-bot/src/main/java/com/javadiscord/bot Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 9
9
import com .javadiscord .jdi .core .models .invite .Invite ;
10
10
import com .javadiscord .jdi .core .models .message .Message ;
11
11
import com .javadiscord .jdi .core .models .message .MessageReaction ;
12
+ import com .javadiscord .jdi .core .models .message .embed .Embed ;
12
13
import com .javadiscord .jdi .core .models .user .User ;
13
14
import com .javadiscord .jdi .internal .api .channel .*;
14
15
@@ -49,6 +50,18 @@ public AsyncResponse<Message> createMessage(CreateMessageBuilder builder) {
49
50
return responseParser .callAndParse (Message .class , builder .build ());
50
51
}
51
52
53
+ public AsyncResponse <Message > sendMessage (long channelId , String message ) {
54
+ return responseParser .callAndParse (
55
+ Message .class , new CreateMessageBuilder (channelId ).content (message ).build ()
56
+ );
57
+ }
58
+
59
+ public AsyncResponse <Message > sendEmbed (long channelId , Embed ... embeds ) {
60
+ return responseParser .callAndParse (
61
+ Message .class , new CreateMessageBuilder (channelId ).embeds (embeds ).build ()
62
+ );
63
+ }
64
+
52
65
public AsyncResponse <MessageReaction > createReaction (
53
66
long channelId ,
54
67
long messageId ,
Original file line number Diff line number Diff line change 1
1
package com .javadiscord .bot ;
2
2
3
+ import com .javadiscord .bot .commands .slash .jshell .JShellService ;
3
4
import com .javadiscord .bot .utils .chatgpt .ChatGPT ;
4
5
import com .javadiscord .jdi .core .Discord ;
5
6
import com .javadiscord .jdi .core .annotations .Component ;
@@ -14,4 +15,9 @@ public static void main(String[] args) {
14
15
public static ChatGPT chatGpt () {
15
16
return new ChatGPT ();
16
17
}
18
+
19
+ @ Component
20
+ public static JShellService jShellService () {
21
+ return new JShellService ();
22
+ }
17
23
}
Original file line number Diff line number Diff line change 4
4
5
5
import com .javadiscord .jdi .core .CommandOptionType ;
6
6
import com .javadiscord .jdi .core .annotations .CommandOption ;
7
+ import com .javadiscord .jdi .core .annotations .Inject ;
7
8
import com .javadiscord .jdi .core .annotations .SlashCommand ;
8
9
import com .javadiscord .jdi .core .interaction .SlashCommandEvent ;
9
10
import com .javadiscord .jdi .core .models .message .embed .Embed ;
10
11
import com .javadiscord .jdi .core .models .message .embed .EmbedAuthor ;
11
12
import com .javadiscord .jdi .core .models .user .User ;
12
13
13
14
public class JShellCommand {
14
- private final JShellService jShellService = new JShellService ();
15
+
16
+ @ Inject
17
+ private JShellService jShellService ;
15
18
16
19
@ SlashCommand (
17
20
name = "jshell" , description = "Run Java code using JShell" , options = {
You can’t perform that action at this time.
0 commit comments