Javacord supports logging in with “real” accounts instead of the normal bot accounts (sometimes also called “selfbots”). However, there are some risks involved with client accounts.
Selfbots violate Discord’s terms of service and using this “feature” will very likely result in a ban of your account.
Client accounts are very similar to bot accounts, but there are some small (undocumented) differences, and Discord changes the client api from time to time without telling us. This means that the same code that worked fine yesterday might no longer work today and break your bot. Fixing these issues is not a priority for Javacord, so in the worst case your bot might not work for several days.
Javacord’s main focus is on bot accounts and logging in with client accounts only exists, because it was very easy to support. Many client-only features (e.g. private/group channel calls) are not supported by Javacord and maybe never will be.
As client accounts violate Discord’s TOS, we might completely remove this feature one day. At the moment it’s pretty easy to maintain support for client accounts, but if Discord starts taking action (e.g. by adding captchas) against selfbots and it would be an unreasonable amount of work to support the client account feature, we will just completely remove it.
If Discord’s going to ask us (or all libraries in general) to remove this feature, we will very likely accept their request.
If you are willing to accept the risks involved in using a selfbot, you first need to get the token of your account.
You can get it by pressing
i and navigating to
Filter the request type to only display
XHR requests and search for a request that contains an
authorization request header.
If you don’t see any requests, just press
r. In this example, the token would be
Logging in to client accounts is very similar to normal bot accounts:
DiscordApi api = new DiscordApiBuilder() .setAccountType(AccountType.CLIENT) .setToken("your token") .login().join(); System.out.println("Logged in!");