Skip to content
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

Merged
merged 15 commits into from
Jul 26, 2018
Merged

Remove user bots #2559

merged 15 commits into from
Jul 26, 2018

Conversation

bdistin
Copy link
Contributor

@bdistin bdistin commented May 19, 2018

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:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

* <warn>This is only filled when using a user account.</warn>
* @type {?boolean}
*/
this.mfaEnabled = typeof data.mfa_enabled === 'boolean' ? data.mfa_enabled : null;
Copy link
Member

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.

* <warn>This is only filled when using a user account.</warn>
* @type {ClientPresenceStore<Snowflake, Presence>}
*/
this.presences = new ClientPresenceStore(this);
Copy link
Member

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

@@ -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}`;
Copy link
Member

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?

Copy link
Contributor Author

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!

bdistin added 2 commits May 27, 2018 12:32
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.
@xDimGG xDimGG mentioned this pull request May 30, 2018
3 tasks
Copy link
Contributor

@Lewdcario Lewdcario left a 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.

@ShayBox
Copy link
Contributor

ShayBox commented Jun 10, 2018

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?

@bdistin
Copy link
Contributor Author

bdistin commented Jun 10, 2018

That's what I did? 51da66e

@Lewdcario Lewdcario dismissed their stale review June 10, 2018 22:39

Outdated

@Lewdcario Lewdcario added this to the 12.0.0 milestone Jun 11, 2018
@bdistin bdistin changed the title [WIP] Remove user bots Remove user bots Jun 20, 2018
@Lewdcario Lewdcario merged commit 5afd77a into discordjs:master Jul 26, 2018
zajrik added a commit to yamdbf/core that referenced this pull request Aug 4, 2018
SpaceEEC added a commit that referenced this pull request Aug 17, 2018
@bdistin bdistin deleted the remove-user-bots branch April 4, 2019 18:43
bonbibonkers added a commit to bonbibonkers/discord.js that referenced this pull request Mar 5, 2020
@discordjs discordjs locked as resolved and limited conversation to collaborators Aug 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants