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,13 +78,16 @@ public class CommandListener extends ListenerAdapter {
}
}
} else {
e.getAuthor().openPrivateChannel().complete().sendMessage(new EmbedBuilder()
.setTitle("No permission")
.setDescription("I need the `MESSAGE WRITE` permission in order to work!")
.setColor(Color.RED)
.setFooter("Hadder", "https://bbn.one/images/Hadder.png")
.setTimestamp(Instant.now())
.build()).queue();
try {
e.getAuthor().openPrivateChannel().complete().sendMessage(new EmbedBuilder()
.setTitle("No permission")
.setDescription("I need the `MESSAGE WRITE` permission in order to work!")
.setColor(Color.RED)
.setFooter("Hadder", "https://bbn.one/images/Hadder.png")
.setTimestamp(Instant.now())
.build()).queue();
} catch (ErrorResponseException ignore) {}
}
}
}