Skip to content

Commit

Permalink
feat: Added WPP.profile.getMyProfilePicture (close #2327)
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Oct 18, 2024
1 parent 77853b4 commit b863dcf
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/profile/functions/getMyProfilePicture.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*!
* Copyright 2024 WPPConnect Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import {
ProfilePicThumbModel,
ProfilePicThumbStore,
UserPrefs,
} from '../../whatsapp';

/**
* Get your current profile picture
*
* @example
* ```javascript
* await WPP.profile.getMyProfilePicture();
* ```
*
* @category Profile
*/

export async function getMyProfilePicture(): Promise<ProfilePicThumbModel> {
const pic = await ProfilePicThumbStore.find(UserPrefs.getMaybeMeUser());

return pic;
}
1 change: 1 addition & 0 deletions src/profile/functions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

export { editBusinessProfile } from './editBusinessProfile';
export { getMyProfileName } from './getMyProfileName';
export { getMyProfilePicture } from './getMyProfilePicture';
export { getMyStatus } from './getMyStatus';
export { isBusiness } from './isBusiness';
export { removeMyProfilePicture } from './removeMyProfilePicture';
Expand Down

0 comments on commit b863dcf

Please sign in to comment.