-
Notifications
You must be signed in to change notification settings - Fork 11
Migration
Kaktushose edited this page Jan 31, 2022
·
2 revisions
The package com.github.kaktushose.jda.commands.entities
has been split up into several packages. Below you can find a list with the new package sorted by class name:
com.github.kaktushose.jda.commands
com.github.kaktushose.jda.commands.embeds
-
com.github.kaktushose.jda.commands.embeds.error
-
com.github.kaktushose.jda.commands.embeds.help
com.github.kaktushose.jda.commands.dispatching
-
The class
EmbedFactory
has been split up intoHelpMessageFactory
andErrorMessageFactory
-
The class
JsonEmbedFactory
has been split up intoJsonHelpMessageFactory
andJsonErrorMessageFactory
new JDACommandsBuilder(jda).build();
JDACommands.start(jda, Main.class);
builder.setEmbedFactory(new JsonEmbedFactory(new File("file.json")))
jdaCommands.getImplementationRegistry().setHelpMessageFactory(
new JsonHelpMessageFactory(new EmbedCache("file.json"))
);
jdaCommands.getImplementationRegistry().setErrorMessageFactory(
new JsonErrorMessageFactory(new EmbedCache("file.json"))
);
jdaCommands.getDefaultSettings().setPrefix("?");
@Component
public class CustomSettingsProvider implements SettingsProvider {
@Override
public GuildSettings getSettings(@Nullable Guild guild) {
return new GuildSettings().setPrefix("?");
}
}
or, alternatively create a jdac.properties
file inside the resources folder:
prefix=?
See the wiki for details.
jdaCommands.getDefaultSettings().getPermissionHolders("moderator").add("id");
@Component
public class PermissionsService implements PermissionsProvider {
@Override
public boolean isMuted(@NotNull User user, @NotNull CommandContext context) {
return false;
}
@Override
public boolean hasPermission(@NotNull User user, @NotNull CommandContext context) {
return user.getId().equals("id");
}
@Override
public boolean hasPermission(@NotNull Member member, @NotNull CommandContext context) {
return hasPermission(member.getUser(), context);
}
See the wiki for details.