Skip to content

Commit

Permalink
Examples - Update to JDA alpha 19
Browse files Browse the repository at this point in the history
  • Loading branch information
freya022 committed Sep 16, 2022
1 parent dfc4ec2 commit 80f6a2f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<dependency> <!-- The Java Discord API-->
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-alpha.18</version>
<version>5.0.0-alpha.19</version>
<exclusions>
<exclusion>
<groupId>club.minnced</groupId>
Expand All @@ -48,12 +48,12 @@
<dependency>
<groupId>io.github.freya022</groupId>
<artifactId>BotCommands</artifactId>
<version>2.5.0</version>
<version>2.6.0</version>
</dependency>
<dependency> <!-- Needed for components, otherwise optional - I use PGSQL but you can use any SQL database -->
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.4.1</version>
<version>42.5.0</version>
</dependency>
<dependency> <!-- Needed to pool SQL connections, optional if you don't use components -->
<groupId>com.zaxxer</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
import com.freya02.botcommands.api.prefixed.annotations.Description;
import com.freya02.botcommands.api.prefixed.annotations.JDATextCommand;
import com.freya02.botcommands.api.prefixed.annotations.TextOption;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;

@CommandMarker //No unused warnings
@Category("Utils")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public class Kick extends TextCommand {
public void exec(BaseCommandEvent event,
@TextOption Member member,
@TextOption(example = "Spam") /* In the help content this parameter will have 'Spam' as a reason example */ @Optional String reason) {
event.getGuild().kick(member, reason).queue();
event.getGuild().kick(member).reason(reason).queue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import com.freya02.botcommands.api.application.slash.GuildSlashEvent;
import com.freya02.botcommands.api.application.slash.annotations.JDASlashCommand;
import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;

public class SlashInfo extends ApplicationCommand {
@JDASlashCommand(name = "info", subcommand = "user")
Expand Down

0 comments on commit 80f6a2f

Please sign in to comment.