File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
src/main/java/org/javacord/bot Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 10
10
import org .javacord .bot .commands .ExampleCommand ;
11
11
import org .javacord .bot .commands .GitHubCommand ;
12
12
import org .javacord .bot .commands .GradleCommand ;
13
+ import org .javacord .bot .commands .InfoCommand ;
13
14
import org .javacord .bot .commands .InviteCommand ;
14
15
import org .javacord .bot .commands .MavenCommand ;
15
16
import org .javacord .bot .commands .Sdcf4jCommand ;
@@ -42,6 +43,7 @@ public static void main(String[] args) {
42
43
handler .registerCommand (new SetupCommand ());
43
44
handler .registerCommand (new WikiCommand ());
44
45
handler .registerCommand (new Sdcf4jCommand ());
46
+ handler .registerCommand (new InfoCommand ());
45
47
}
46
48
47
49
}
Original file line number Diff line number Diff line change
1
+ package org .javacord .bot .commands ;
2
+
3
+ import de .btobastian .sdcf4j .Command ;
4
+ import de .btobastian .sdcf4j .CommandExecutor ;
5
+ import org .javacord .api .DiscordApi ;
6
+ import org .javacord .api .Javacord ;
7
+ import org .javacord .api .entity .channel .TextChannel ;
8
+ import org .javacord .api .entity .message .embed .EmbedBuilder ;
9
+ import org .javacord .bot .Constants ;
10
+
11
+ public class InfoCommand implements CommandExecutor {
12
+
13
+ @ Command (aliases = "!info" , async = true )
14
+ public void handleCommand (TextChannel channel ) {
15
+ final DiscordApi api = channel .getApi ();
16
+ EmbedBuilder embed = new EmbedBuilder ()
17
+ .setColor (Constants .JAVACORD_ORANGE )
18
+ .setTitle (api .getYourself ().getName () + " - Official Javacord Bot" )
19
+ .setThumbnail (api .getYourself ().getAvatar ())
20
+ .setDescription ("The official bot for the Javacord Server\n \n " +
21
+ "Powered by Javacord and sdcf4j" )
22
+ .addInlineField ("GitHub" , "https://github.com/Javacord/Javacord-Bot" )
23
+ .addInlineField ("Javacord Version" , Javacord .VERSION )
24
+ .addInlineField ("sdcf4j Version" , "v1.0.10" );
25
+
26
+ channel .sendMessage (embed ).join ();
27
+ }
28
+
29
+ }
You can’t perform that action at this time.
0 commit comments