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

Commit e256abd

Browse files
authored
Merge branch 'master' into feature/format
2 parents 2e01dd3 + 33a4636 commit e256abd

File tree

5 files changed

+34
-1
lines changed

5 files changed

+34
-1
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ Java bot with many features. Developed by @CodeDoctorDE (Discord: CodeDoctor#871
2323
### What is it?
2424
Guess what word the writer has chosen. This is a turn based game. Every player can join in.
2525

26+
# Contributing
27+
28+
To contribute, fork this repository and create a pull request. If you want you can also join my discord. If you contribute more, you can get the contributor role.
29+
30+
## Branches
31+
32+
Name | Description
33+
--- | ---
34+
feature/* | Every new feature will developed here
35+
hotfix/* | Fixing bugs will be developed here
36+
master | Every feature and hotfix will be merged here
37+
stable | Stable changes will be merged here
38+
2639
# Current servers
2740
You can visit my bot on this servers:
2841
* [KniffelGames](https://discord.gg/J7EUgvN)

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: 6 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,10 @@ else if (content.startsWith(normalMention))
4547
try {
4648
if (!Linwood.getInstance().getBaseCommand().onCommand(session, event.getMessage(), guild, prefix, command))
4749
event.getChannel().sendMessageFormat(bundle.getString("Syntax"), commandBundle.getString("Syntax")).queue();
48-
} catch (Exception e) {
50+
}catch(PermissionException e){
51+
event.getChannel().sendMessage(bundle.getString("InsufficientPermission")).queue();
52+
e.printStackTrace();
53+
}catch (Exception e) {
4954
event.getChannel().sendMessage(bundle.getString("Error")).queue();
5055
e.printStackTrace();
5156
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%s
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%s
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)