-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make JMusicBot error & shut down if ran in an unsupported manner (#1486)
* Make JMusicBot error & shut down if ran in an unsupported manner * add info about message content intent * five second rule --------- Co-authored-by: unknown <john.a.grosh@gmail.com>
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,12 @@ | |
import java.net.URLConnection; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
|
||
import net.dv8tion.jda.api.JDA; | ||
import net.dv8tion.jda.api.OnlineStatus; | ||
import net.dv8tion.jda.api.entities.Activity; | ||
import net.dv8tion.jda.api.entities.ApplicationInfo; | ||
import net.dv8tion.jda.api.entities.User; | ||
import okhttp3.*; | ||
import org.json.JSONException; | ||
import org.json.JSONObject; | ||
|
@@ -207,4 +211,20 @@ public static String getLatestVersion() | |
return null; | ||
} | ||
} | ||
|
||
/** | ||
* Checks if the bot JMusicBot is being run on is supported & returns the reason if it is not. | ||
* @return A string with the reason, or null if it is supported. | ||
*/ | ||
public static String getUnsupportedBotReason(JDA jda) | ||
{ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jagrosh
Author
Owner
|
||
if (jda.getSelfUser().getFlags().contains(User.UserFlag.VERIFIED_BOT)) | ||
return "The bot is verified. Using JMusicBot in a verified bot is not supported."; | ||
|
||
ApplicationInfo info = jda.retrieveApplicationInfo().complete(); | ||
if (info.isBotPublic()) | ||
return "\"Public Bot\" is enabled. Using JMusicBot as a public bot is not supported. Please disable it in the Developer Dashboard."; | ||
|
||
return null; | ||
} | ||
} |
Why was this change made?
I want to give the benefit of the doubt and assume this is because of some API change, but I've seen this practice done enough times before to rightly assume that this is intentionally limited just to make a paywalled version without the limit.
Seeing as #1486 is now locked for being "too heated" after 3 comments, it looks like this is the direction @jagrosh wants to take this repository. Don't get me wrong, I'm not against paywalling like this if it is done with 100% transparency (which this is not, there are no mentions of this in the changelog).
The least malicious way to go about this is to be transparent about limits (like this one) and enabling limited features only in "free" builds, but not when compiling from source. (This is how aseprite makes money, sort of. The hassle of not having to build it every update is what you pay for, as well as some additional creature comforts. You'd be surprised how many people would pay for that!)
I'm really, really, really hoping this is not something malicious, and this is something that is related to the new way bots work on discord. I don't make discord bots!!! Please prove me wrong!!