Skip to content

Commit

Permalink
fix: Fixed queryGroupInviteCode function (close #1890)
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed May 2, 2024
1 parent 22a8749 commit b4ec6a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/whatsapp/functions/queryGroupInviteCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import { exportModule } from '../exportModule';
* @whatsapp 153438
*/
export declare function queryGroupInviteCode(
groupId: Wid
groupId: Wid,
iAmAdmin: boolean
): Promise<{ code: string }>;

exportModule(
Expand Down
6 changes: 5 additions & 1 deletion src/whatsapp/functions/sendQueryGroupInviteCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

import { iAmAdmin } from '../../group';
import * as webpack from '../../webpack';
import { Wid } from '..';
import { exportModule } from '../exportModule';
Expand All @@ -32,6 +33,9 @@ exportModule(

webpack.injectFallbackModule('sendQueryGroupInviteCode', {
sendQueryGroupInviteCode: async (groupId: Wid) => {
return await queryGroupInviteCode(groupId).then((value) => value.code);
const isAdmin = await iAmAdmin(groupId);
return await queryGroupInviteCode(groupId, isAdmin).then(
(value) => value.code
);
},
});

0 comments on commit b4ec6a8

Please sign in to comment.