Catch no permission exception

This commit is contained in:
Greg 2021-04-11 02:08:58 +02:00
parent 4d06604292
commit 0427689f5d
No known key found for this signature in database
GPG key ID: E0CCA757E2B9BA17

View file

@ -78,6 +78,7 @@ public class CommandListener extends ListenerAdapter {
} }
} }
} else { } else {
try {
e.getAuthor().openPrivateChannel().complete().sendMessage(new EmbedBuilder() e.getAuthor().openPrivateChannel().complete().sendMessage(new EmbedBuilder()
.setTitle("No permission") .setTitle("No permission")
.setDescription("I need the `MESSAGE WRITE` permission in order to work!") .setDescription("I need the `MESSAGE WRITE` permission in order to work!")
@ -85,6 +86,8 @@ public class CommandListener extends ListenerAdapter {
.setFooter("Hadder", "https://bbn.one/images/Hadder.png") .setFooter("Hadder", "https://bbn.one/images/Hadder.png")
.setTimestamp(Instant.now()) .setTimestamp(Instant.now())
.build()).queue(); .build()).queue();
} catch (ErrorResponseException ignore) {}
} }
} }
} }