Skip to content

Commit

Permalink
feat: Added WPP.contact.getBusinessProfile function
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta authored and edgardmessias committed Aug 10, 2022
1 parent a74ac3c commit 5c8e57a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/contact/functions/getBusinessProfile.ts
@@ -0,0 +1,43 @@
/*!
* Copyright 2021 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 { assertWid } from '../../assert';
import {
BusinessProfileModel,
BusinessProfileStore,
Wid,
} from '../../whatsapp';

/**
* Get the current text status
*
* @example
* ```javascript
* const url = await WPP.contact.getBusinessProfile('[number]@c.us');
* ```
*
* @category Contact
*/

export async function getBusinessProfile(
contactId: string | Wid
): Promise<BusinessProfileModel> {
const wid = assertWid(contactId);

const profile = await BusinessProfileStore.fetchBizProfile(wid);

return profile;
}
1 change: 1 addition & 0 deletions src/contact/functions/index.ts
Expand Up @@ -15,6 +15,7 @@
*/

export { getProfilePictureUrl } from './getProfilePictureUrl';
export { getBusinessProfile } from './getBusinessProfile';
export { getStatus } from './getStatus';
export { ContactListOptions, list } from './list';
export { queryExists } from './queryExists';

0 comments on commit 5c8e57a

Please sign in to comment.