Catch no permission exception
This commit is contained in:
parent
4d06604292
commit
0427689f5d
1 changed files with 10 additions and 7 deletions
|
|
@ -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) {}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue