Fixed bug with permissions

This commit is contained in:
Savvy 2017-10-02 22:37:06 -04:00
parent d4f6a52d44
commit c6b613eae6

View File

@ -170,6 +170,7 @@ public class MessageEvent {
@SubscribeEvent
public void onReact(MessageReactionAddEvent event) {
try {
Message message = event.getChannel().getMessageById(event.getMessageId()).complete();
if (message == null || message.getEmbeds().size() != 1) return;
MessageEmbed embed = message.getEmbeds().get(0);
@ -185,6 +186,10 @@ public class MessageEvent {
} catch (Exception e) {
e.printStackTrace();
}
} catch (PermissionException pex) {
if (pex.getPermission() == Permission.MESSAGE_READ) return;
pex.printStackTrace();
}
}
@SubscribeEvent