Friendlier handling of default webhook values on bot launch#1263
Merged
Zabuzard merged 1 commit intoTogether-Java:developfrom Jun 27, 2025
Merged
Friendlier handling of default webhook values on bot launch#1263Zabuzard merged 1 commit intoTogether-Java:developfrom
Zabuzard merged 1 commit intoTogether-Java:developfrom
Conversation
I have noticed that when inexperienced people just getting started on
the project go through all the hoops of cloning the repository, setting
up their Discord bots, creating their test server, they end up compiling
the code in IDEs like IntelliJ IDEA and assuming they just change the
token on their `config.json`, there are stacktraces and errors thrown
once they attempt to run the bot. Specifically:
Caused by: java.net.URISyntaxException: Illegal character in path at index 0: <put_your_webhook_here>
at java.base/java.net.URI$Parser.fail(URI.java:2995)
at java.base/java.net.URI$Parser.checkChars(URI.java:3166)
at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3248)
at java.base/java.net.URI$Parser.parse(URI.java:3207)
at java.base/java.net.URI.<init>(URI.java:645)
at java.base/java.net.URI.create(URI.java:930)
For the average software engineer, they would be aware that the program
is still running and that the bot is ready, but two things:
- Someone who is not trained enough and is just starting to contribute
will get thrown off by the error and potentially give up (I have
experienced it happening)
- It's a generally better experience for knowledgable new contributors
to set up the project effortlessly so that they can get started with
contributing straight away without any stacktraces.
This commit prints a friendly warning in the logger and no stacktrace in
case the user has not updated the webhooks (which most of them will not
have to, as they are primarily concerned with the Discord bot's token).
We hide the stacktrace in case there is a "<put_your_webhook_here>"
value in the "logInfoChannelWebhook" and "logErrorChannelWebhook"
configuration keys so that IntelliJ IDEA does not put the stacktrace in
the spotlight and potentially scare new contributors.
Signed-off-by: christolis <work@chris-sdogkos.com>
Zabuzard
approved these changes
Jun 27, 2025
christolis
added a commit
to christolis/TJ-Bot
that referenced
this pull request
Jun 28, 2025
I have noticed that when inexperienced people just getting started on
the project go through all the hoops of cloning the repository, setting
up their Discord bots, creating their test server, they end up compiling
the code in IDEs like IntelliJ IDEA and assuming they just change the
token on their `config.json`, there are stacktraces and errors thrown
once they attempt to run the bot. Specifically:
Caused by: java.net.URISyntaxException: Illegal character in path at index 0: <put_your_webhook_here>
at java.base/java.net.URI$Parser.fail(URI.java:2995)
at java.base/java.net.URI$Parser.checkChars(URI.java:3166)
at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3248)
at java.base/java.net.URI$Parser.parse(URI.java:3207)
at java.base/java.net.URI.<init>(URI.java:645)
at java.base/java.net.URI.create(URI.java:930)
For the average software engineer, they would be aware that the program
is still running and that the bot is ready, but two things:
- Someone who is not trained enough and is just starting to contribute
will get thrown off by the error and potentially give up (I have
experienced it happening)
- It's a generally better experience for knowledgable new contributors
to set up the project effortlessly so that they can get started with
contributing straight away without any stacktraces.
This commit prints a friendly warning in the logger and no stacktrace in
case the user has not updated the webhooks (which most of them will not
have to, as they are primarily concerned with the Discord bot's token).
We hide the stacktrace in case there is a "<put_your_webhook_here>"
value in the "logInfoChannelWebhook" and "logErrorChannelWebhook"
configuration keys so that IntelliJ IDEA does not put the stacktrace in
the spotlight and potentially scare new contributors.
Signed-off-by: christolis <work@chris-sdogkos.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I have noticed that when inexperienced people just getting started on the project go through all the hoops of cloning the repository, setting up their Discord bots, creating their test server, they end up compiling the code in IDEs like IntelliJ IDEA and assuming they just change the token on their
config.json, there are stacktraces and errors thrown once they attempt to run the bot. Specifically:For the average software engineer, they would be aware that the program is still running and that the bot is ready, but two things:
What I've done
This commit prints a friendly warning in the logger and no stacktrace in case the user has not updated the webhooks (which most of them will not have to, as they are primarily concerned with the Discord bot's token).
We hide the stacktrace in case there is a
<put_your_webhook_here>value in thelogInfoChannelWebhookandlogErrorChannelWebhookconfiguration keys so that IntelliJ IDEA does not put the stacktrace in the spotlight and potentially scare new contributors.