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

Guild Role Update - Added mentionable to old role #387

Merged
merged 1 commit into from
May 11, 2018
Merged

Guild Role Update - Added mentionable to old role #387

merged 1 commit into from
May 11, 2018

Conversation

motoenduroboy
Copy link
Contributor

-Added mentionable to oldRole on event GUILD_ROLE_UPDATE

-Added mentionable to oldRole on event GUILD_ROLE_UPDATE
@Brayzure
Copy link
Contributor

Just some general commentary, but why don't we just pass the old role as-is? Why do we create another vanilla object, and copy properties over?

@motoenduroboy
Copy link
Contributor Author

Probably a good idea unless @abalabahaha has a reason behind it?

@abalabahaha
Copy link
Owner

update() updates the roles in place so you would be getting two of the same object...

var oldRole = {name: "foo"};

var newRole = oldRole; // Both pointing to the same object
(function update(role, data) { // Over-simplified update()
    role.name = data.name;
})(newRole, {name: "bar"});

emit("roleUpdate", newRole, oldRole); // ("roleUpdate", {name: "bar"}, {name: "bar"})

@abalabahaha abalabahaha merged commit 9186054 into abalabahaha:dev May 11, 2018
nandub added a commit to nandub/eris that referenced this pull request May 22, 2018
* upstream/master:
  0.8.6
  Bump ws dependency
  Prevent command overwriting in CommandClient (abalabahaha#389)
  Fix PermissionOverwrite docs, lint
  Add role.mentionable to guildRoleUpdate (abalabahaha#387)
  Remove global reaction ratelimit (abalabahaha#388)
  Update Message.cleanContent (fix abalabahaha#377) (abalabahaha#378)
  Send WS close code 1000 on Shard.disconnect() (abalabahaha#383)
  Change how duplicate presences are detected (abalabahaha#376)
  Fix OggOpusTransformer for multi-track files (abalabahaha#380)
  Added closeVoiceConnection() (abalabahaha#368)
  Add new system messages (abalabahaha#375)
  Remove ImageSizes array and fix minimum image size
  Typings: Renamed dynamicIconURL in User to dynamicAvatarURL (abalabahaha#373)
nandub added a commit to nandub/eris that referenced this pull request May 22, 2018
* upstream/master:
  0.8.6
  Bump ws dependency
  Prevent command overwriting in CommandClient (abalabahaha#389)
  Fix PermissionOverwrite docs, lint
  Add role.mentionable to guildRoleUpdate (abalabahaha#387)
  Remove global reaction ratelimit (abalabahaha#388)
  Update Message.cleanContent (fix abalabahaha#377) (abalabahaha#378)
  Send WS close code 1000 on Shard.disconnect() (abalabahaha#383)
  Change how duplicate presences are detected (abalabahaha#376)
  Fix OggOpusTransformer for multi-track files (abalabahaha#380)
  Added closeVoiceConnection() (abalabahaha#368)
  Add new system messages (abalabahaha#375)
  Remove ImageSizes array and fix minimum image size
  Typings: Renamed dynamicIconURL in User to dynamicAvatarURL (abalabahaha#373)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants