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