mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-03-11 22:29:46 +01:00
Run interaction commands async for now (hopefully okay)
This commit is contained in:
parent
7279be7850
commit
4cb861badc
@ -61,7 +61,8 @@ public class InteractionControllerImpl extends ListenerAdapter implements Intera
|
||||
interactionEvent.reply(tl("noAccessCommand"));
|
||||
return;
|
||||
}
|
||||
//jda.getPlugin().getEss().scheduleSyncDelayedTask(() -> command.onCommand(interactionEvent)); //todo
|
||||
|
||||
command.onCommand(interactionEvent);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,7 +22,7 @@ public class ExecuteCommand extends InteractionCommandImpl {
|
||||
public void onCommand(final InteractionEvent event) {
|
||||
final String command = event.getStringArgument("command");
|
||||
event.reply(tl("discordCommandExecuteReply", command));
|
||||
Bukkit.getScheduler().runTask(jda.getPlugin(), () -> {
|
||||
jda.getPlugin().getEss().scheduleGlobalDelayedTask(() -> {
|
||||
try {
|
||||
Bukkit.dispatchCommand(new DiscordCommandSender(jda, Bukkit.getConsoleSender(), message -> event.reply(MessageUtil.sanitizeDiscordMarkdown(message))).getSender(), command);
|
||||
} catch (CommandException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user