Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit 33a4636

Browse files
author
CodeDoctorDE
committed
remove unused capture of sentry
1 parent f599ffb commit 33a4636

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

src/main/java/com/github/codedoctorde/linwood/apps/single/game/mode/whatisit/WhatIsItEvents.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
77
import net.dv8tion.jda.api.events.message.react.MessageReactionAddEvent;
88
import net.dv8tion.jda.api.events.message.react.MessageReactionRemoveEvent;
9+
import net.dv8tion.jda.api.exceptions.PermissionException;
910
import net.dv8tion.jda.api.hooks.SubscribeEvent;
1011

1112
import java.text.MessageFormat;
@@ -40,6 +41,9 @@ public void onGuess(MessageReceivedEvent event){
4041
}
4142
session.close();
4243
}
44+
catch(PermissionException e){
45+
e.printStackTrace();
46+
}
4347
catch(Exception e){
4448
e.printStackTrace();
4549
Sentry.capture(e);
@@ -51,6 +55,9 @@ public void onWord(MessageReceivedEvent event) {
5155
if (event.getChannelType() == ChannelType.PRIVATE && whatIsIt.getRound() != null && whatIsIt.getRound().getWriterId() == event.getAuthor().getIdLong() && whatIsIt.getRound().getWord() == null)
5256
whatIsIt.getRound().startRound(event.getMessage().getContentStripped());
5357
}
58+
catch(PermissionException e){
59+
e.printStackTrace();
60+
}
5461
catch(Exception e){
5562
e.printStackTrace();
5663
Sentry.capture(e);
@@ -83,6 +90,9 @@ public void onJoin(MessageReactionAddEvent event){
8390
session.close();
8491
});
8592
}
93+
catch(PermissionException e){
94+
e.printStackTrace();
95+
}
8696
catch(Exception e){
8797
e.printStackTrace();
8898
Sentry.capture(e);
@@ -99,6 +109,9 @@ public void onLeave(MessageReactionRemoveEvent event){
99109
session.close();
100110
});
101111
}
112+
catch(PermissionException e){
113+
e.printStackTrace();
114+
}
102115
catch(Exception e){
103116
e.printStackTrace();
104117
Sentry.capture(e);

src/main/java/com/github/codedoctorde/linwood/listener/CommandListener.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import io.sentry.Sentry;
66
import net.dv8tion.jda.api.entities.ChannelType;
77
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
8+
import net.dv8tion.jda.api.exceptions.InsufficientPermissionException;
9+
import net.dv8tion.jda.api.exceptions.PermissionException;
810
import net.dv8tion.jda.api.hooks.SubscribeEvent;
911
import org.apache.tools.ant.types.Commandline;
1012

@@ -45,7 +47,11 @@ else if (content.startsWith(normalMention))
4547
try {
4648
if (!Linwood.getInstance().getBaseCommand().onCommand(session, event.getMessage(), guild, prefix, command))
4749
event.getChannel().sendMessage(MessageFormat.format(bundle.getString("Syntax"), commandBundle.getString("Syntax"))).queue();
48-
} catch (Exception e) {
50+
}
51+
catch(PermissionException e){
52+
event.getChannel().sendMessage(bundle.getString("InsufficientPermission")).queue();
53+
e.printStackTrace();
54+
}catch (Exception e) {
4955
event.getChannel().sendMessage(bundle.getString("Error")).queue();
5056
e.printStackTrace();
5157
Sentry.capture(e);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Syntax=Falsche Benutzung. Bitte nutze: \n{0}
22
Error=Ein unerwarteter Fehler ist passiert! Sollte es noch einmal passieren, kontaktiere bitte den Entwickler
33
NoPermission=:no_entry_sign: Keine Rechte!
4+
InsufficientPermission=**:warning: Der Bot hat keine Rechte dies zu tun! :warning: **
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Syntax=Wrong usage. Please use: \n{0}
22
Error=An error has occurred! Please contact the developer if it happens multiple times!
33
NoPermission=:no_entry_sign: No permission!
4+
InsufficientPermission=**:warning: The bot has no permission to do this! :warning: **

0 commit comments

Comments
 (0)