require(`./paths-Bcdg3ma0.cjs`);const e=require(`./logger-CMTXcXUA.cjs`);require(`./proxy-env-CxZAYxjP.cjs`);const t=require(`./fetch-timeout-BygUD0rd.cjs`),n=require(`./proxy-fetch-BRtmAK5t.cjs`);require(`./fetch-ClKErpni.cjs`);const r=require(`./fetch-DuZqnoLu.cjs`);async function i(i){let a=r.t(i.proxyUrl?n.n(i.proxyUrl):void 0,{network:i.network}),o=`https://api.telegram.org/bot${i.token}`,s=[];for(let n of i.groupIds)try{let r=await t.n(`${o}/getChatMember?chat_id=${encodeURIComponent(n)}&user_id=${encodeURIComponent(String(i.botId))}`,{},i.timeoutMs,a),c=await r.json();if(!r.ok||!e.f(c)||!c.ok){let t=e.f(c)&&!c.ok&&typeof c.description==`string`?c.description:`getChatMember failed (${r.status})`;s.push({chatId:n,ok:!1,status:null,error:t,matchKey:n,matchSource:`id`});continue}let l=e.f(c.result)?c.result.status??null:null,u=l===`creator`||l===`administrator`||l===`member`;s.push({chatId:n,ok:u,status:l,error:u?null:`bot not in group`,matchKey:n,matchSource:`id`})}catch(e){s.push({chatId:n,ok:!1,status:null,error:e instanceof Error?e.message:String(e),matchKey:n,matchSource:`id`})}return{ok:s.every(e=>e.ok),checkedGroups:s.length,unresolvedGroups:0,hasWildcardUnmentionedGroups:!1,groups:s}}exports.auditTelegramGroupMembershipImpl=i;
