-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove user bots #2559
Remove user bots #2559
Conversation
src/structures/ClientUser.js
Outdated
* <warn>This is only filled when using a user account.</warn> | ||
* @type {?boolean} | ||
*/ | ||
this.mfaEnabled = typeof data.mfa_enabled === 'boolean' ? data.mfa_enabled : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field is actually filled when using a bot account.
true
when the owner has mfa enabled, false
if not.
src/client/Client.js
Outdated
* <warn>This is only filled when using a user account.</warn> | ||
* @type {ClientPresenceStore<Snowflake, Presence>} | ||
*/ | ||
this.presences = new ClientPresenceStore(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this must remain for bots with friends and to handle the presence of the client
src/rest/RESTManager.js
Outdated
@@ -39,8 +39,7 @@ class RESTManager { | |||
|
|||
getAuth() { | |||
const token = this.client.token || this.client.accessToken; | |||
const prefixed = !!this.client.application || (this.client.user && this.client.user.bot); | |||
if (token && prefixed) return `${this.tokenPrefix} ${token}`; | |||
if (token && this.client.application) return `${this.tokenPrefix} ${token}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this cause a big issue for bot accounts if this.client.application is undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that was a derp. Good catch!
Had the user/bot portions of the code mixed up. Though, does this need to be a promise anymore?
It nolonger needs to be a promise, and nothing depended on it being a promise that I can tell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The passing of an argument to Client#fetchApplication should be removed. Bots cannot even access other bots from the same owner, it seems.
I use fetchApplication on the bot user itself to get info, maybe just remove the param so it can only get the logged in bot? |
That's what I did? 51da66e |
To be in-line with discordjs/discord.js#2559
This reverts commit 5afd77a.
Please describe the changes this PR makes and why it should be merged:
One of the milestone updates for v12 is the removal of user bot support (as it's been made clear use of which is against the TOS anyway). This pr attempts to accomplish that milestone.
Semantic versioning classification: