From 6b00f83e7d0ec716e61c22707276817106de8e0b Mon Sep 17 00:00:00 2001 From: Skillz Date: Thu, 21 May 2020 23:32:42 -0400 Subject: [PATCH] remove remaining raw --- README.md | 8 +------- utils/permissions.ts | 5 ++--- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8923f21d0..e1661d206 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ This project began out of the desire to want to learn and enhance my developer s - `Note:` This means for every tiny bug fix/change you need to manually update the code every time. So if a new feature is added, you would need to bump the version in your code. - Each version is also available through a specific branch. For example `v2` branch holds all the version 2 code. This branch is always updated whenever a MINOR or PATCH update is made that will NOT break your bots. - `Note:` This means you never have to update your code EXCEPT when you are ready to bump to next MAJOR version. So if a new feature is added, it will be added automatically. If a small bug is fixed it will be automatic. - + # Overview This section will list out all the available methods and functionality in the library. When you use them in your editor you will be able to get much more useful information. Documentation is built into your editor. @@ -80,7 +80,6 @@ This section will list out all the available methods and functionality in the li .messageDelete(message) .nicknameUpdate(guild, member, nickname, oldNickname) .presenceUpdate(data) -.raw(data) .ready() .reactionAdd(message, emoji, userID) .reactionRemove(message, emoji, userID) @@ -117,7 +116,6 @@ This section will list out all the available methods and functionality in the li - lastPinTimestamp - nsfw - mention -- raw ```ts - .hasPermission(id, permissions) - .getMessage(id) @@ -164,7 +162,6 @@ This section will list out all the available methods and functionality in the li - premiumTier - premiumSubscriptionCount - preferredLocale -- raw - joinedAt ```ts - .categoryChildrenIDs(id) @@ -222,7 +219,6 @@ This section will list out all the available methods and functionality in the li - roles - deaf - mute -- raw - joinedAt - premiumSince - tag @@ -261,7 +257,6 @@ This section will list out all the available methods and functionality in the li - applications - messageReference - flags -- raw - author - timestamp - editedTimestamp @@ -288,7 +283,6 @@ This section will list out all the available methods and functionality in the li - permissions - managed - mentionable -- raw - mention ## User diff --git a/utils/permissions.ts b/utils/permissions.ts index 7973aeb37..32074798e 100644 --- a/utils/permissions.ts +++ b/utils/permissions.ts @@ -42,9 +42,8 @@ export function botHasPermission(guildID: string, permissions: Permissions[]) { const member = guild.members.get(botID); if (!member) return false; - const permissionBits = [...guild.roles.values()] - .map((role) => role.raw) - .filter((role) => member.roles.includes(role.id)) + const permissionBits = member.roles + .map((id) => guild.roles.get(id)!) .reduce((bits, data) => { bits |= data.permissions;