We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aed364a commit 5adf115Copy full SHA for 5adf115
src/utils/chattools.js
@@ -29,6 +29,10 @@ async function getMembersList(chat) {
29
* @returns {string[]} - Serialized phone numbers of all administrators.
30
*/
31
async function getAdmsList(chat) {
32
+ if (!chat.isGroup) {
33
+ throw new Error(`This chat isn't a group.`);
34
+ }
35
+
36
const members = await chat.participants;
37
const admsIdList = members.filter((id) => id.isAdmin);
38
const admsSerialList = getSerialList(admsIdList);
0 commit comments